test_health.py 692 B

12345678910111213141516171819202122
  1. from fastapi.testclient import TestClient
  2. from app.main import app
  3. def test_health() -> None:
  4. with TestClient(app) as client:
  5. response = client.get("/health")
  6. assert response.status_code == 200
  7. payload = response.json()
  8. assert payload["status"] == "ok"
  9. assert payload["database"]["dialect"] == "sqlite"
  10. assert payload["agent"]["framework"] == "deepagents"
  11. def test_frontend_app_mount() -> None:
  12. with TestClient(app) as client:
  13. response = client.get("/app/")
  14. assert response.status_code == 200
  15. assert response.headers["content-type"].startswith("text/html")
  16. assert "./api.js" in response.text
  17. assert "./app.js" in response.text