- move the relational data center to MySQL and a standalone workbench\n- add Interface Center API credentials, policies, logs, and DBeaver SSH guidance\n- harden authentication and deployment while retiring unused management surfaces
68 lines
2.1 KiB
Python
68 lines
2.1 KiB
Python
import unittest
|
|
|
|
from app.main import app
|
|
|
|
|
|
class ManagementSurfaceTests(unittest.TestCase):
|
|
def test_schema_routes_remain_available(self) -> None:
|
|
paths = {route.path for route in app.routes}
|
|
|
|
self.assertIn("/v1/admin/ontology-schemas", paths)
|
|
self.assertIn("/v1/admin/ontology-schemas/current", paths)
|
|
self.assertIn("/v1/admin/ontology-schemas/{schema_id}", paths)
|
|
|
|
def test_retired_management_apis_are_not_registered(self) -> None:
|
|
paths = {route.path for route in app.routes}
|
|
retired_prefixes = (
|
|
"/v1/admin/source-profiles",
|
|
"/v1/admin/batches",
|
|
"/v1/admin/conflicts",
|
|
"/v1/admin/entities",
|
|
"/v1/admin/evidence",
|
|
"/v1/admin/inventory",
|
|
"/v1/admin/treatment-history",
|
|
"/v1/admin/vocabulary",
|
|
"/v1/admin/aligner",
|
|
"/v1/admin/publish-jobs",
|
|
"/v1/admin/acquisition-tasks",
|
|
"/v1/admin/manual-ingest",
|
|
"/v1/admin/audit",
|
|
"/v1/admin/audit-runs",
|
|
"/v1/admin/question-traces",
|
|
"/v1/admin/simulation-panel",
|
|
"/v1/admin/areas",
|
|
"/v1/admin/notifications",
|
|
"/v1/admin/agent-settings",
|
|
)
|
|
|
|
for prefix in retired_prefixes:
|
|
self.assertFalse(
|
|
any(path == prefix or path.startswith(f"{prefix}/") for path in paths),
|
|
prefix,
|
|
)
|
|
|
|
for path in (
|
|
"/v1/admin/plaza/usage",
|
|
"/v1/admin/plaza/alerts",
|
|
"/v1/admin/users/{user_id}/areas",
|
|
):
|
|
self.assertNotIn(path, paths)
|
|
|
|
def test_retained_core_routes_remain_registered(self) -> None:
|
|
paths = {route.path for route in app.routes}
|
|
|
|
for path in (
|
|
"/v1/admin/plaza/overview",
|
|
"/v1/admin/plaza/user-query",
|
|
"/v1/admin/graph/overview",
|
|
"/v1/admin/users",
|
|
"/v1/admin/roles",
|
|
"/v1/admin/permission-matrix",
|
|
"/v1/admin/ocr/passport",
|
|
):
|
|
self.assertIn(path, paths)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|