from collections.abc import AsyncIterator import httpx import pytest from knowledge_adapter.app import create_app @pytest.fixture async def client() -> AsyncIterator[httpx.AsyncClient]: transport = httpx.ASGITransport(app=create_app()) async with httpx.AsyncClient(transport=transport, base_url="http://test") as value: yield value async def test_healthz_reports_only_adapter_liveness(client: httpx.AsyncClient) -> None: response = await client.get("/healthz") assert response.status_code == 200 assert response.json() == {"status": "ok"} assert set(response.headers) >= {"content-type"} async def test_api_documentation_is_not_exposed(client: httpx.AsyncClient) -> None: for path in ("/docs", "/redoc", "/openapi.json"): response = await client.get(path) assert response.status_code == 404