def test_process(self): class FooVisitor(inspect.InspectVisitor): def visit_route(self, route): return 'foo' assert FooVisitor().process(inspect.RouteInfo('f', 'o', 'o', [])) == 'foo'
def test_inspect_visitor(self): iv = inspect.InspectVisitor() with pytest.raises(RuntimeError, match='This visitor does not support'): iv.process(123) with pytest.raises(RuntimeError, match='This visitor does not support'): iv.process(inspect.RouteInfo('f', 'o', 'o', []))
def print_routes(r): assert r is app._router return [inspect.RouteInfo('foo', 'bar', '', [])]