Futurisys_API_ML / tests /fonctionnel /test_predict_endpoint.py
Aurélie GABU
pytest new tests added
70cbf26
raw
history blame contribute delete
470 Bytes
# tests/functional/test_predict_endpoint.py
from fastapi.testclient import TestClient
from App.main import app
from tests.sample_payload import valid_payload
client = TestClient(app)
def test_predict_endpoint():
response = client.post("/predict", json=valid_payload)
assert response.status_code == 200
body = response.json()
assert "Prediction" in body
assert "Probabilite_depart" in body
assert isinstance(body["Probabilite_depart"], float)