Download tests/test_api.py from sdhaos/faiq-ai: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/sdhaos/faiq-ai/resolve/main/tests/test_api.py
- Command line
-
hf download hf://sdhaos/faiq-ai/tests/test_api.py
-
curl -L -o test_api.py https://huggingface.co/sdhaos/faiq-ai/resolve/main/tests/test_api.py
727 Bytes
| from fastapi.testclient import TestClient | |
| from app.api import create_router | |
| from app.config import Settings | |
| from app.main import app | |
| def test_health_contract(): | |
| response = TestClient(app).get("/health") | |
| assert response.status_code == 200 | |
| assert response.json()["service"] == "Faiq AI" | |
| def test_models_contract(): | |
| response = TestClient(app).get("/v1/models") | |
| assert response.status_code == 200 | |
| assert [item["id"] for item in response.json()["models"]] == ["faiq", "danish"] | |
| def test_stream_is_explicitly_unimplemented(monkeypatch): | |
| response = TestClient(app).post("/v1/chat/completions", json={"messages":[{"role":"user","content":"hi"}],"stream":True}) | |
| assert response.status_code == 501 | |