import pytest from httpx import AsyncClient, ASGITransport from app.main import app class TestMainApp: """Tests for main app endpoints.""" @pytest.fixture async def client(self): """Create test client.""" transport = ASGITransport(app=app) async with AsyncClient(transport=transport, base_url="http://test") as ac: yield ac async def test_root_endpoint(self, client): """Test root endpoint returns app info.""" response = await client.get("/") assert response.status_code == 200 data = response.json() assert data["message"] == "KOL Insight API" assert data["version"] == "1.0.0" async def test_health_endpoint(self, client): """Test health check endpoint.""" response = await client.get("/health") assert response.status_code == 200 data = response.json() assert data["status"] == "healthy"