"""Cubre los endpoints obligatorios del shape: /health y /metrics.""" from fastapi.testclient import TestClient def test_health_returns_200_ok(client: TestClient) -> None: response = client.get("/health") assert response.status_code == 200 assert response.json() == {"status": "ok"} def test_health_propagates_correlation_id(client: TestClient) -> None: cid = "test-cid-12345" response = client.get("/health", headers={"X-Correlation-ID": cid}) assert response.headers.get("X-Correlation-ID") == cid def test_health_generates_correlation_id_when_absent(client: TestClient) -> None: response = client.get("/health") assert response.headers.get("X-Correlation-ID") def test_metrics_endpoint_serves_prometheus_format(client: TestClient) -> None: response = client.get("/metrics") assert response.status_code == 200 assert "text/plain" in response.headers.get("content-type", "")