diff options
Diffstat (limited to 'tests/test_gzipper.py')
-rw-r--r-- | tests/test_gzipper.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_gzipper.py b/tests/test_gzipper.py index 4f929b0..54b7901 100644 --- a/tests/test_gzipper.py +++ b/tests/test_gzipper.py @@ -1,11 +1,11 @@ from paste.fixture import TestApp from paste.gzipper import middleware import gzip -from six.moves import cStringIO as StringIO +import six def simple_app(environ, start_response): start_response('200 OK', [('content-type', 'text/plain')]) - return 'this is a test' + return [b'this is a test'] wsgi_app = middleware(simple_app) app = TestApp(wsgi_app) @@ -14,6 +14,6 @@ def test_gzip(): res = app.get( '/', extra_environ=dict(HTTP_ACCEPT_ENCODING='gzip')) assert int(res.header('content-length')) == len(res.body) - assert res.body != 'this is a test' - actual = gzip.GzipFile(fileobj=StringIO(res.body)).read() - assert actual == 'this is a test' + assert res.body != b'this is a test' + actual = gzip.GzipFile(fileobj=six.BytesIO(res.body)).read() + assert actual == b'this is a test' |