- from fastapi.testclient import TestClient
- from app.main import app
- client = TestClient(app)
- def test_health():
- r = client.get("/api/health")
- assert r.status_code == 200
- body = r.json()
- assert body["code"] == 200
- assert body["data"]["status"] == "ok"
- assert "timestamp" in body
|