oraculo_api / tests /api /test_health_api.py
Diiegoal's picture
Actualizo la app
d623240
Raw
History Blame Contribute Delete
802 Bytes
from fastapi.testclient import TestClient
def test_root_returns_service_metadata(client: TestClient) -> None:
response = client.get("/")
assert response.status_code == 200
body = response.json()
assert body["service"]
assert body["version"]
assert body["environment"] == "test"
def test_live_health_endpoint(client: TestClient) -> None:
response = client.get("/api/v1/health/live")
assert response.status_code == 200
assert response.json()["status"] == "ok"
def test_ready_health_endpoint(client: TestClient) -> None:
response = client.get("/api/v1/health/ready")
assert response.status_code == 200
body = response.json()
assert body["status"] == "ready"
assert body["model_loaded"] is True
assert body["database_connected"] is True