test: increased cb test coverage
This commit is contained in:
committed by
Luijkx,S.O.H. (Storm)
parent
de2e56ffce
commit
7f7c658901
16
test/unit/api/v1/endpoints/test_router.py
Normal file
16
test/unit/api/v1/endpoints/test_router.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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("/sse") for p in paths)
|
||||
assert any(p.startswith("/logs") for p in paths)
|
||||
assert any(p.startswith("/program") for p in paths)
|
||||
Reference in New Issue
Block a user