Spaces:
Sleeping
Sleeping
Download tests/fonctionnel/test_predict_endpoint.py from Diaure/Futurisys_API_ML: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/spaces/Diaure/Futurisys_API_ML/resolve/main/tests/fonctionnel/test_predict_endpoint.py
- Command line
-
hf download hf://spaces/Diaure/Futurisys_API_ML/tests/fonctionnel/test_predict_endpoint.py
-
curl -L -o test_predict_endpoint.py https://huggingface.co/spaces/Diaure/Futurisys_API_ML/resolve/main/tests/fonctionnel/test_predict_endpoint.py
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) | |