update tests/unit/test_models.py
Browse files- tests/unit/test_models.py +17 -0
tests/unit/test_models.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
from app.models.proxy import Proxy
|
| 3 |
+
from uuid import UUID
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test_proxy_model_creation():
|
| 7 |
+
proxy_data = {
|
| 8 |
+
"ip": "127.0.0.1",
|
| 9 |
+
"port": 8080,
|
| 10 |
+
"protocol": "http",
|
| 11 |
+
"source": "manual",
|
| 12 |
+
}
|
| 13 |
+
proxy = Proxy(**proxy_data)
|
| 14 |
+
assert proxy.ip == "127.0.0.1"
|
| 15 |
+
assert proxy.port == 8080
|
| 16 |
+
assert isinstance(proxy.id, UUID)
|
| 17 |
+
assert proxy.anonymity == "transparent"
|