Rewrite leftover HTTP routers except auth.
Project ingest, pipeline enqueue/SSE, reports, admin, contact, survey, and feedback now resolve from src. Auth router is unchanged.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
"""HTTP routers resolve from periscope/src (auth stays leftover)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import backend.routers.admin as admin
|
||||
import backend.routers.contact as contact
|
||||
import backend.routers.deps as deps
|
||||
import backend.routers.feedback as feedback
|
||||
import backend.routers.pipeline as pipeline
|
||||
import backend.routers.projects as projects
|
||||
import backend.routers.reports as reports
|
||||
import backend.routers.survey as survey
|
||||
|
||||
|
||||
def _src(mod, name: str) -> None:
|
||||
path = Path(mod.__file__).resolve()
|
||||
assert path.name == name
|
||||
assert "src" in path.parts
|
||||
assert "Native Periscope overlay" not in path.read_text(encoding="utf-8")[:400]
|
||||
|
||||
|
||||
def test_inherited_routers_are_src():
|
||||
for mod, name in (
|
||||
(admin, "admin.py"),
|
||||
(contact, "contact.py"),
|
||||
(deps, "deps.py"),
|
||||
(feedback, "feedback.py"),
|
||||
(pipeline, "pipeline.py"),
|
||||
(projects, "projects.py"),
|
||||
(reports, "reports.py"),
|
||||
(survey, "survey.py"),
|
||||
):
|
||||
_src(mod, name)
|
||||
|
||||
|
||||
def test_auth_router_is_not_rewritten_this_slice():
|
||||
import backend.routers.auth as auth
|
||||
|
||||
path = Path(auth.__file__).resolve()
|
||||
assert path.name == "auth.py"
|
||||
assert "src" in path.parts
|
||||
|
||||
|
||||
def test_reprocess_helper_names():
|
||||
assert callable(pipeline._await_terminal)
|
||||
assert callable(pipeline._project_active)
|
||||
assert callable(projects._bom_file_to_csv_bytes)
|
||||
Reference in New Issue
Block a user