"""Cubre el endpoint /demo: sirve el index estático.""" from fastapi.testclient import TestClient def test_demo_serves_index_html(client: TestClient) -> None: response = client.get("/demo/") assert response.status_code == 200 assert "text/html" in response.headers.get("content-type", "") assert "__APP_NAME__" in response.text or "demo" in response.text.lower() def test_metrics_endpoint_responds(client: TestClient) -> None: response = client.get("/metrics") assert response.status_code == 200 assert "text/plain" in response.headers.get("content-type", "") def test_openapi_accessible_when_auth_disabled(client: TestClient) -> None: response = client.get("/openapi.json") assert response.status_code == 200 spec = response.json() assert spec["info"]["title"] == "__APP_NAME__"