""" Tests for core router (health check and root endpoints). """ import pytest from fastapi.testclient import TestClient from src.core.config import config @pytest.mark.unit def test_health_check(client: TestClient) -> None: """Test health check endpoint returns healthy status.""" response = client.get("/health") assert response.status_code == 200 data = response.json() assert data["status"] == "healthy" assert data["version"] == config.APP_VERSION @pytest.mark.unit def test_root_endpoint(client: TestClient) -> None: """Test root endpoint returns API information.""" response = client.get("/") assert response.status_code == 200 data = response.json() assert data["name"] == config.APP_NAME assert data["version"] == config.APP_VERSION assert data["docs"] == "/docs" @pytest.mark.unit def test_docs_accessible(client: TestClient) -> None: """Test that OpenAPI docs are accessible.""" response = client.get("/docs") assert response.status_code == 200 @pytest.mark.unit def test_openapi_schema(client: TestClient) -> None: """Test that OpenAPI schema is accessible.""" response = client.get("/openapi.json") assert response.status_code == 200 schema = response.json() assert schema["info"]["title"] == config.APP_NAME assert schema["info"]["version"] == config.APP_VERSION