def test_override_basePath(loop): router = SwaggerRouter(search_dirs=['tests']) web.Application(router=router, loop=loop) prefix = '/override' router.include('data/root.yaml', basePath=prefix) paths = [url for url in [ route.url_for().human_repr() for route in router.routes() ] if url.startswith(prefix)] assert prefix in router._swagger_data assert paths
def test_route_include(swagger_router: SwaggerRouter): paths = [route.url_for().human_repr() for route in swagger_router.routes()] assert '/api/1/include2/inc/image' in paths, paths
def test_handler(swagger_router: SwaggerRouter): paths = [(route.method, route.url_for().human_repr()) for route in swagger_router.routes()] assert ('GET', '/api/1/include/image') in paths
def test_routes(swagger_router: SwaggerRouter): paths = [route.url_for().human_repr() for route in swagger_router.routes()] assert '/api/1/file/image' in paths