Files
awoooi/apps/api/tests/test_platform_router_order.py
Your Name ae7c7cbd23
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 1m14s
CD Pipeline / build-and-deploy (push) Successful in 3m43s
CD Pipeline / post-deploy-checks (push) Successful in 1m29s
feat(awooop): summarize automation quality
2026-05-13 15:56:42 +08:00

50 lines
1.4 KiB
Python

from __future__ import annotations
from src.api.v1.platform import router
def test_runs_list_route_is_registered_before_dynamic_run_id() -> None:
paths = [
route.path
for route in router.routes
if "GET" in getattr(route, "methods", set())
]
assert "/runs/list" in paths
assert "/runs/{run_id}/detail" in paths
assert "/runs/{run_id}" in paths
assert paths.index("/runs/list") < paths.index("/runs/{run_id}")
assert paths.index("/runs/{run_id}/detail") < paths.index("/runs/{run_id}")
def test_recent_events_route_is_registered() -> None:
paths = [
route.path
for route in router.routes
if "GET" in getattr(route, "methods", set())
]
assert "/events/recent" in paths
def test_truth_chain_route_is_registered() -> None:
paths = [
route.path
for route in router.routes
if "GET" in getattr(route, "methods", set())
]
assert "/truth-chain/{source_id}" in paths
def test_truth_chain_quality_summary_route_is_registered_before_dynamic_source_id() -> None:
paths = [
route.path
for route in router.routes
if "GET" in getattr(route, "methods", set())
]
assert "/truth-chain/quality/summary" in paths
assert "/truth-chain/{source_id}" in paths
assert paths.index("/truth-chain/quality/summary") < paths.index("/truth-chain/{source_id}")