medilang-tech / tests /test_api.py
Dama03's picture
first push of the AI
411a994
raw
history blame
592 Bytes
from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
def test_health():
r = client.get("/health")
assert r.status_code == 200
def test_cameroon_data_endpoints_exist():
r1 = client.get("/api/cameroon-data/stats/overview")
assert r1.status_code in (200, 500) # 500 if CSV not configured
r2 = client.get("/api/cameroon-data/patterns/seasonal")
assert r2.status_code in (200, 500)
r3 = client.post("/api/cameroon-data/search/similar-cases", json={"query_text": "fever", "top_k": 3})
assert r3.status_code in (200, 500)