first commit
This commit is contained in:
commit
34ea15a54d
246 changed files with 18660 additions and 0 deletions
19
backend/tests/test_health.py
Normal file
19
backend/tests/test_health.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
||||
def test_health_endpoint() -> None:
|
||||
response = client.get("/api/health")
|
||||
assert response.status_code in (200, 503)
|
||||
body = response.json()
|
||||
assert body["service"] == "desi-clans-api"
|
||||
assert "database" in body
|
||||
assert body["status"] in ("ok", "degraded")
|
||||
|
||||
if response.status_code == 200:
|
||||
assert body["database"] == "connected"
|
||||
else:
|
||||
assert body["database"] == "unavailable"
|
||||
Loading…
Add table
Add a link
Reference in a new issue