Files
fastapi-todolist/tests/test_health.py
T
dengwenhao 2fedb6736a
Deploy TodoList / deploy (push) Failing after 2s
ci: add deployment workflow and automated tests
2026-07-31 09:38:39 +08:00

15 lines
375 B
Python

from fastapi.testclient import TestClient
def test_health_returns_success(client: TestClient) -> None:
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_unknown_route_returns_404(client: TestClient) -> None:
response = client.get("/not-exist")
assert response.status_code == 404