test_health.py 304 B

12345678910111213
  1. from fastapi.testclient import TestClient
  2. from app.main import app
  3. client = TestClient(app)
  4. def test_health():
  5. r = client.get("/api/health")
  6. assert r.status_code == 200
  7. body = r.json()
  8. assert body["code"] == 200
  9. assert body["data"]["status"] == "ok"
  10. assert "timestamp" in body