| """Tests for API endpoints.""" | |
| from __future__ import annotations | |
| import pytest | |
| from fastapi.testclient import TestClient | |
| from app.main import app | |
| client = TestClient(app) | |
| def test_health_check(): | |
| response = client.get("/health") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["status"] == "ok" | |
| assert data["service"] == "ISP Handbook Service" | |
| def test_font_diagnostics(): | |
| response = client.get("/diagnostics/fonts") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert "font_dir" in data | |
| assert "variants" in data | |
| def test_openapi_schema(): | |
| response = client.get("/openapi.json") | |
| assert response.status_code == 200 | |
| schema = response.json() | |
| assert "paths" in schema | |
| assert "/health" in schema["paths"] | |
| assert "/api/v1/handbook/pdf" in schema["paths"] | |
| def test_docs_page(): | |
| response = client.get("/docs") | |
| assert response.status_code == 200 | |