- Organized and grouped import statements for better readability in health.py, metadata.py, releases.py, scan.py, search.py, version.py, viewer.py, and registry.py. - Updated type hints to use the new union syntax (e.g., str | None) for better clarity in scan.py, settings.py, tool_detect.py, and result.py. - Enhanced the handling of optional types in various functions to ensure more robust type checking. - Removed unnecessary blank lines and improved formatting for consistency. - Adjusted the logic in several test files to ensure compatibility with the updated import structure and type hints. (See <attachments> above for file contents. You may not need to search or read the file again.)
20 lines
496 B
Python
20 lines
496 B
Python
from aiohttp import web
|
|
from mjr_am_backend.routes.handlers.version import register_version_routes
|
|
|
|
|
|
def test_version_route_aliases_are_registered():
|
|
routes = web.RouteTableDef()
|
|
register_version_routes(routes)
|
|
|
|
app = web.Application()
|
|
app.add_routes(routes)
|
|
|
|
canonical = {
|
|
r.resource.canonical
|
|
for r in app.router.routes()
|
|
if getattr(r, "method", "") == "GET"
|
|
}
|
|
|
|
assert "/mjr/am/version" in canonical
|
|
assert "/majoor/version" in canonical
|