Files
fastapi-todolist/tests/test_health.py
T

15 lines
375 B
Python
Raw Normal View History

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