From ce98a9219e060b729d4b0d2dc28bf4510649f0fd Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 17 Oct 2016 16:38:31 +1300 Subject: test & examples: zap six --- test/pathod/test_language_http.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/pathod/test_language_http.py') diff --git a/test/pathod/test_language_http.py b/test/pathod/test_language_http.py index dd0b8d02..e1eabe4a 100644 --- a/test/pathod/test_language_http.py +++ b/test/pathod/test_language_http.py @@ -1,4 +1,4 @@ -from six import BytesIO +import io from pathod import language from pathod.language import http, base @@ -10,7 +10,7 @@ def parse_request(s): def test_make_error_response(): - d = BytesIO() + d = io.BytesIO() s = http.make_error_response("foo") language.serve(s, d, {}) @@ -76,7 +76,7 @@ class TestRequest: assert r[0].values({}) def test_render(self): - s = BytesIO() + s = io.BytesIO() r = parse_request("GET:'/foo'") assert language.serve( r, @@ -163,7 +163,7 @@ class TestResponse: assert b"OK" in [i[:] for i in r.preamble({})] def test_render(self): - s = BytesIO() + s = io.BytesIO() r = next(language.parse_pathod("400:m'msg'")) assert language.serve(r, s, {}) @@ -173,13 +173,13 @@ class TestResponse: assert "p0" not in s.spec() def test_raw(self): - s = BytesIO() + s = io.BytesIO() r = next(language.parse_pathod("400:b'foo'")) language.serve(r, s, {}) v = s.getvalue() assert b"Content-Length" in v - s = BytesIO() + s = io.BytesIO() r = next(language.parse_pathod("400:b'foo':r")) language.serve(r, s, {}) v = s.getvalue() @@ -187,7 +187,7 @@ class TestResponse: def test_length(self): def testlen(x): - s = BytesIO() + s = io.BytesIO() x = next(x) language.serve(x, s, language.Settings()) assert x.length(language.Settings()) == len(s.getvalue()) @@ -198,7 +198,7 @@ class TestResponse: def test_maximum_length(self): def testlen(x): x = next(x) - s = BytesIO() + s = io.BytesIO() m = x.maximum_length({}) language.serve(x, s, {}) assert m >= len(s.getvalue()) -- cgit v1.2.3