summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:01:23 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:01:23 +0200
commita866d3fe38fc7c212abf90355ecffe51864ccf5b (patch)
treeb0138fe3094d857aac3d024e2d984288849759c7 /tests
parent781a97d181b95e1b67183f4c5536dc2cdd924ac4 (diff)
downloadpaste-a866d3fe38fc7c212abf90355ecffe51864ccf5b.tar.gz
Port gzipper to Python 3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gzipper.py10
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'