Files
pdf/gateway/tests/test_health.py
T

26 lines
837 B
Python

"""`/health` is the load-balancer probe — it must keep working even when the
engine bridge is absent (Phase 0 default)."""
from fastapi.testclient import TestClient
def test_health_returns_ok(client: TestClient) -> None:
response = client.get("/health")
assert response.status_code == 200
payload = response.json()
assert payload["status"] == "ok"
assert payload["engine_available"] is False
assert "version" in payload
assert "environment" in payload
def test_health_does_not_require_engine(client: TestClient) -> None:
"""Regression guard: importing the app and hitting /health must not
transitively import the pybind11 module (which doesn't exist yet)."""
import sys
response = client.get("/health")
assert response.status_code == 200
assert "pdfengine" not in sys.modules