16 lines
605 B
Python
16 lines
605 B
Python
from fastapi.routing import APIRoute
|
|
|
|
from control_backend.api.v1.router import api_router # <--- corrected import
|
|
|
|
|
|
def test_router_includes_expected_paths():
|
|
"""Ensure api_router includes main router prefixes."""
|
|
routes = [r for r in api_router.routes if isinstance(r, APIRoute)]
|
|
paths = [r.path for r in routes]
|
|
|
|
# Ensure at least one route under each prefix exists
|
|
assert any(p.startswith("/robot") for p in paths)
|
|
assert any(p.startswith("/message") for p in paths)
|
|
assert any(p.startswith("/logs") for p in paths)
|
|
assert any(p.startswith("/program") for p in paths)
|