From 497e8e4ff14e2293a4515e91649ea69b66a473b8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:18:30 +0000 Subject: [PATCH] feat(tests): implement health route tests - Implemented `test_health_returns_200` to verify the `/health` endpoint status. - Implemented `test_health_contains_required_fields` to verify the structure of the health response. - Updated docstrings to align with implementation and API structure. Co-authored-by: SarmaHighOnCode <218538054+SarmaHighOnCode@users.noreply.github.com> --- backend/tests/test_api.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/tests/test_api.py b/backend/tests/test_api.py index 150e0a9..668e3b5 100644 --- a/backend/tests/test_api.py +++ b/backend/tests/test_api.py @@ -16,13 +16,17 @@ class TestHealthEndpoint: def test_health_returns_200(self) -> None: """Health endpoint should return 200 with status info.""" - # TODO: Implement when health route is registered - pass + response = client.get("/health") + assert response.status_code == 200 def test_health_contains_required_fields(self) -> None: - """Health response should contain status, model_loaded, gpu_available.""" - # TODO: Implement - pass + """Health response should contain status, model_loaded, and nested gpu info.""" + response = client.get("/health") + data = response.json() + assert "status" in data + assert "model_loaded" in data + assert "gpu" in data + assert "available" in data["gpu"] class TestStylesEndpoint: