We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3116663 commit c16fca6Copy full SHA for c16fca6
1 file changed
backend/tests/test_predict.py
@@ -0,0 +1,19 @@
1
+from fastapi.testclient import TestClient
2
+from backend.main import app
3
+
4
+client = TestClient(app)
5
6
+def test_predict_endpoint():
7
+ payload = {
8
+ "source_ip": "10.0.0.1",
9
+ "destination_ip": "10.0.0.2",
10
+ "bytes_sent": 1000,
11
+ "bytes_received": 2000,
12
+ "protocol": "TCP",
13
+ "failed_login_count": 0
14
+ }
15
+ resp = client.post("/predict/", json=payload)
16
+ assert resp.status_code == 200
17
+ body = resp.json()
18
+ for key in ("score", "label", "confidence"):
19
+ assert key in body
0 commit comments