示例#1
0
    def test_router(self):
        def foo(req, quux):
            print quux

        r = siesta.Router()
        r.add("/foo/{quux:int}", siesta.llsd_callable(foo), methods=["GET"])
        req = siesta.Request.blank("/foo/33")
        req.get_response(r)

        req = siesta.Request.blank("/foo/bar")
        self.assertEquals(req.get_response(r).status_int, exc.HTTPNotFound.code)
示例#2
0
    def test_router(self):
        def foo(req, quux):
            print quux

        r = siesta.Router()
        r.add('/foo/{quux:int}', siesta.llsd_callable(foo), methods=['GET'])
        req = siesta.Request.blank('/foo/33')
        req.get_response(r)

        req = siesta.Request.blank('/foo/bar')
        self.assertEquals(
            req.get_response(r).status_int, exc.HTTPNotFound.code)
示例#3
0
 def __init__(self, *args, **kwargs):
     unittest.TestCase.__init__(self, *args, **kwargs)
     self.server = siesta.llsd_callable(callable_app)
示例#4
0
 def __init__(self, *args, **kwargs):
     unittest.TestCase.__init__(self, *args, **kwargs)
     self.server = siesta.llsd_callable(callable_app)