summaryrefslogtreecommitdiff
path: root/tests/test_dec.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dec.py')
-rw-r--r--tests/test_dec.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_dec.py b/tests/test_dec.py
index 3c4c186..1c0200f 100644
--- a/tests/test_dec.py
+++ b/tests/test_dec.py
@@ -1,9 +1,9 @@
import unittest
+
+from webob.dec import wsgify
from webob.request import Request
from webob.response import Response
-from webob.dec import wsgify
-from webob.compat import bytes_
-from webob.compat import text_
+from webob.util import bytes_, text_
class DecoratorTests(unittest.TestCase):
@@ -11,6 +11,7 @@ class DecoratorTests(unittest.TestCase):
if isinstance(req, str):
req = Request.blank(req)
resp = req.get_response(app)
+
return resp
def test_wsgify(self):
@@ -70,7 +71,7 @@ class DecoratorTests(unittest.TestCase):
def test_wsgify_no___get__(self):
# use a class instance instead of a fn so we wrap something w/
# no __get__
- class TestApp(object):
+ class TestApp:
def __call__(self, req):
return "nothing to see here"
@@ -162,6 +163,7 @@ class DecoratorTests(unittest.TestCase):
@wsgify
def test_app(req):
self.assertEqual(req.method, "PUT")
+
return Response(req.body)
resp = test_app.request("/url/path", method="PUT", body=resp_str)
@@ -198,6 +200,7 @@ class DecoratorTests(unittest.TestCase):
@wsgify.middleware
def set_urlvar(req, app, **vars):
req.urlvars.update(vars)
+
return app(req)
from webob.dec import _MiddlewareFactory
@@ -223,6 +226,7 @@ class DecoratorTests(unittest.TestCase):
@wsgify.middleware
def set_args(req, app, **kwargs):
req.urlvars = kwargs
+
return req.get_response(app)
@wsgify
@@ -240,6 +244,7 @@ class DecoratorTests(unittest.TestCase):
@wsgify.middleware
def set_args(req, app, **kwargs):
req.urlvars = kwargs
+
return req.get_response(app)
@wsgify
@@ -257,6 +262,7 @@ class DecoratorTests(unittest.TestCase):
@wsgify.middleware
def set_urlvar(req, app, **vars):
req.urlvars.update(vars)
+
return app(req)
@set_urlvar(a=1, b=2)