diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py index de256626f..4b4d1ff96 100644 --- a/test/pathod/test_language_http2.py +++ b/test/pathod/test_language_http2.py @@ -1,4 +1,4 @@ -from six.moves import cStringIO as StringIO +from six import BytesIO import netlib from netlib import tcp @@ -25,7 +25,7 @@ def default_settings(): def test_make_error_response(): - d = StringIO() + d = BytesIO() s = http2.make_error_response("foo", "bar") language.serve(s, d, default_settings()) @@ -84,7 +84,7 @@ class TestRequest: assert r[1].method.string() == "GET" def test_render_simple(self): - s = StringIO() + s = BytesIO() r = parse_request("GET:'/foo'") assert language.serve( r, @@ -126,7 +126,7 @@ class TestRequest: assert r.headers[0].values(default_settings()) == ("user-agent", user_agents.get_by_shortcut('a')[2]) def test_render_with_headers(self): - s = StringIO() + s = BytesIO() r = parse_request('GET:/foo:h"foo"="bar"') assert language.serve( r, @@ -142,7 +142,7 @@ class TestRequest: assert r.values(default_settings()) def test_render_with_body(self): - s = StringIO() + s = BytesIO() r = parse_request("GET:'/foo':bfoobar") assert language.serve( r, @@ -199,7 +199,7 @@ class TestResponse: assert r.body.string() == "foobar" def test_render_simple(self): - s = StringIO() + s = BytesIO() r = parse_response('200') assert language.serve( r, @@ -208,7 +208,7 @@ class TestResponse: ) def test_render_with_headers(self): - s = StringIO() + s = BytesIO() r = parse_response('200:h"foo"="bar"') assert language.serve( r, @@ -217,7 +217,7 @@ class TestResponse: ) def test_render_with_body(self): - s = StringIO() + s = BytesIO() r = parse_response('200:bfoobar') assert language.serve( r,