def test_compiled_no_method_map(self): r = routing.CompiledRouter() r.add_route('/foo', i_f.MyResponder()) # clear the method map r._roots[0].method_map.clear() ri = inspect.inspect_compiled_router(r) assert ri[0].path == '/foo' assert ri[0].class_name == 'MyResponder' assert ri[0].methods == []
def test_compiled_partial(self): r = routing.CompiledRouter() r.add_route('/foo', i_f.MyResponder()) # override a method with a partial r._roots[0].method_map['GET'] = partial(r._roots[0].method_map['GET']) ri = inspect.inspect_compiled_router(r) for m in ri[0].methods: if m.method == 'GET': assert '_inspect_fixture' in m.source_info