aboutsummaryrefslogtreecommitdiffstats
path: root/test/pathod/test_language_http2.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-03-20 19:40:03 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-03-20 19:40:03 +0100
commit88d365cfe671bc5c8d96e78334337aa84cc815da (patch)
tree21a9bfd946cc5b8958d1b3549a277b51a456ba19 /test/pathod/test_language_http2.py
parent61a657fe56949732d6470862c2ebbe09141f85f2 (diff)
downloadmitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.tar.gz
mitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.tar.bz2
mitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.zip
py3++: cStringIO
Diffstat (limited to 'test/pathod/test_language_http2.py')
-rw-r--r--test/pathod/test_language_http2.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py
index 8e9f188c..abfe4606 100644
--- a/test/pathod/test_language_http2.py
+++ b/test/pathod/test_language_http2.py
@@ -1,4 +1,4 @@
-import cStringIO
+from six.moves import cStringIO as StringIO
import netlib
from netlib import tcp
@@ -25,7 +25,7 @@ def default_settings():
def test_make_error_response():
- d = cStringIO.StringIO()
+ d = StringIO()
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 = cStringIO.StringIO()
+ s = StringIO()
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 = cStringIO.StringIO()
+ s = StringIO()
r = parse_request('GET:/foo:h"foo"="bar"')
assert language.serve(
r,
@@ -143,7 +143,7 @@ class TestRequest:
def test_render_with_body(self):
- s = cStringIO.StringIO()
+ s = StringIO()
r = parse_request("GET:'/foo':bfoobar")
assert language.serve(
r,
@@ -200,7 +200,7 @@ class TestResponse:
assert r.body.string() == "foobar"
def test_render_simple(self):
- s = cStringIO.StringIO()
+ s = StringIO()
r = parse_response('200')
assert language.serve(
r,
@@ -209,7 +209,7 @@ class TestResponse:
)
def test_render_with_headers(self):
- s = cStringIO.StringIO()
+ s = StringIO()
r = parse_response('200:h"foo"="bar"')
assert language.serve(
r,
@@ -218,7 +218,7 @@ class TestResponse:
)
def test_render_with_body(self):
- s = cStringIO.StringIO()
+ s = StringIO()
r = parse_response('200:bfoobar')
assert language.serve(
r,