generated from john/python-template
27 lines
823 B
Python
27 lines
823 B
Python
"""Tests for UI page registration wiring."""
|
|
|
|
import pytest
|
|
from fastapi import FastAPI
|
|
from fastapi.testclient import TestClient
|
|
|
|
from transcription.ui import register_pages
|
|
|
|
|
|
@pytest.mark.integration
|
|
class TestPageRegistration:
|
|
"""Verify page registration and route wiring."""
|
|
|
|
def test_register_pages_adds_expected_routes(self):
|
|
"""register_pages wires upload and jobs routes into the app."""
|
|
app = FastAPI()
|
|
register_pages(app)
|
|
app.add_api_route("/healthz", lambda: {"status": "ok"}, methods=["GET"])
|
|
|
|
client = TestClient(app)
|
|
ui_response = client.get("/ui")
|
|
health_response = client.get("/healthz")
|
|
|
|
assert ui_response.status_code == 200
|
|
assert health_response.status_code == 200
|
|
assert health_response.json() == {"status": "ok"}
|