(summary) add minimal test suite for health endpoint

Based on cameldev's work, introduce basic tests to ensure the
health endpoint responds correctly.
This commit is contained in:
lebaudantoine
2026-03-17 22:08:00 +01:00
committed by aleb_the_flash
parent bfbfade99a
commit 83bd9c5ce3
6 changed files with 51 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
"""Tests for the summary service."""
+1
View File
@@ -0,0 +1 @@
"""Tests for the API summary service."""
+21
View File
@@ -0,0 +1,21 @@
"""Integration tests for the health check endpoints."""
class TestHeartbeat:
"""Tests for the /__heartbeat__ endpoint."""
def test_returns_200(self, client):
"""The heartbeat endpoint responds with 200 OK without a token."""
response = client.get("/__heartbeat__")
assert response.status_code == 200
class TestLBHeartbeat:
"""Tests for the /__lbheartbeat__ endpoint."""
def test_returns_200(self, client):
"""The load-balancer heartbeat endpoint responds with 200 OK without a token."""
response = client.get("/__lbheartbeat__")
assert response.status_code == 200
+12
View File
@@ -0,0 +1,12 @@
"""Integration test configuration. Provides shared fixtures."""
import pytest
from fastapi.testclient import TestClient
from summary.main import app
@pytest.fixture()
def client():
"""Provide a FastAPI TestClient for integration tests."""
return TestClient(app)