diff options
Diffstat (limited to 'test/unit/common/test_swob.py')
-rw-r--r-- | test/unit/common/test_swob.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/common/test_swob.py b/test/unit/common/test_swob.py index 2d645234a..ccbe6d2f9 100644 --- a/test/unit/common/test_swob.py +++ b/test/unit/common/test_swob.py @@ -914,6 +914,22 @@ class TestRequest(unittest.TestCase): self.assertEqual(used_req[0].path, '/hi/there') self.assertEqual(resp.status_int, 200) + def test_wsgify_method(self): + class _wsgi_class(object): + def __init__(self): + self.used_req = [] + + @swob.wsgify + def __call__(self, req): + self.used_req.append(req) + return swob.Response(b'200 OK') + + req = swob.Request.blank('/hi/there') + handler = _wsgi_class() + resp = req.get_response(handler) + self.assertIs(handler.used_req[0].environ, req.environ) + self.assertEqual(resp.status_int, 200) + def test_wsgify_raise(self): used_req = [] |