コード例 #1
0
ファイル: server.py プロジェクト: karelin/Exhibitionist
    def is_http_handler(self, o):
        from exhibitionist.decorators import http_handler
        import inspect
        import tornado.web

        return (http_handler.is_decorated_as_http(o) and
                (inspect.isclass(o) and issubclass(o,
                                                   tornado.web.RequestHandler)))
コード例 #2
0
    def test_marker_substitution(self):
        import re

        @http_handler("#{0}#".format(OBJID_PLACEHOLDER))
        class A(ExhibitionistRequestHandler):
            pass

        self.assertTrue(OBJID_REGEX_GROUP_NAME in re.compile(http_handler.get_route(A)).groupindex)
        self.assertTrue(http_handler.is_decorated_as_http(A))