コード例 #1
0
ファイル: test_inspect.py プロジェクト: hzdwang/falcon-1
    def test_process(self):
        class FooVisitor(inspect.InspectVisitor):
            def visit_route(self, route):
                return 'foo'

        assert FooVisitor().process(inspect.RouteInfo('f', 'o', 'o',
                                                      [])) == 'foo'
コード例 #2
0
ファイル: test_inspect.py プロジェクト: hzdwang/falcon-1
 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', []))
コード例 #3
0
ファイル: test_inspect.py プロジェクト: hzdwang/falcon-1
 def print_routes(r):
     assert r is app._router
     return [inspect.RouteInfo('foo', 'bar', '', [])]