Spaces:
Sleeping
Sleeping
File size: 1,346 Bytes
6b8bb0d 1239f44 6b8bb0d 122cdd6 6b8bb0d e61da91 122cdd6 e61da91 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | """User-facing entrypoint regression tests."""
from __future__ import annotations
import subprocess
import sys
def test_cli_help_runs_from_project_root() -> None:
"""Given the installed project, CLI help should run without import workarounds."""
result = subprocess.run(
[sys.executable, "-m", "src.interfaces.cli", "--help"],
check=False,
capture_output=True,
text=True,
)
assert result.returncode == 0, result.stderr
assert "debug-retrieval" in result.stdout
assert "retrieval-telemetry" in result.stdout
def test_api_exposes_complete_learning_surface() -> None:
"""Given the API module, all advertised learning routes should be registered."""
from src.interfaces.api import app
routes = {route.path for route in app.routes}
assert {
"/health",
"/documents",
"/upload",
"/ask",
"/summarize",
"/quiz",
"/flashcards",
"/monitoring/retrieval/summary",
} <= routes
def test_gradio_app_imports_without_optional_logo() -> None:
"""Given no logo asset, importing the Gradio application should still succeed."""
from app import demo
assert demo is not None
assert any(
getattr(route, "path", None) == "/monitoring/retrieval/summary"
for route in demo.app.routes
)
|