handbook_engine / tests /test_api.py
internationalscholarsprogram's picture
fix: ISP handbook styling overhaul - margins, typography, emphasis, benefits, CSS cascade
ec94fc1
raw
history blame contribute delete
958 Bytes
"""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