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)
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)
def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.server = siesta.llsd_callable(callable_app)