diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-03-20 19:40:03 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-03-20 19:40:03 +0100 |
commit | 88d365cfe671bc5c8d96e78334337aa84cc815da (patch) | |
tree | 21a9bfd946cc5b8958d1b3549a277b51a456ba19 /test/pathod/test_pathoc.py | |
parent | 61a657fe56949732d6470862c2ebbe09141f85f2 (diff) | |
download | mitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.tar.gz mitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.tar.bz2 mitmproxy-88d365cfe671bc5c8d96e78334337aa84cc815da.zip |
py3++: cStringIO
Diffstat (limited to 'test/pathod/test_pathoc.py')
-rw-r--r-- | test/pathod/test_pathoc.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 280a9141..8d0f92ac 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -1,5 +1,5 @@ import json -import cStringIO +from six.moves import cStringIO as StringIO import re import OpenSSL import pytest @@ -64,7 +64,7 @@ class _TestDaemon: ignoretimeout=None, showsummary=True ): - s = cStringIO.StringIO() + s = StringIO() c = pathoc.Pathoc( ("127.0.0.1", self.d.port), ssl=self.ssl, @@ -129,7 +129,7 @@ class TestDaemonSSL(_TestDaemon): assert d["log"][0]["request"]["clientcert"]["keyinfo"] def test_http2_without_ssl(self): - fp = cStringIO.StringIO() + fp = StringIO() c = pathoc.Pathoc( ("127.0.0.1", self.d.port), use_http2=True, @@ -227,15 +227,15 @@ class TestDaemon(_TestDaemon): def test_connect_fail(self): to = ("foobar", 80) c = pathoc.Pathoc(("127.0.0.1", self.d.port), fp=None) - c.rfile, c.wfile = cStringIO.StringIO(), cStringIO.StringIO() + c.rfile, c.wfile = StringIO(), StringIO() with raises("connect failed"): c.http_connect(to) - c.rfile = cStringIO.StringIO( + c.rfile = StringIO( "HTTP/1.1 500 OK\r\n" ) with raises("connect failed"): c.http_connect(to) - c.rfile = cStringIO.StringIO( + c.rfile = StringIO( "HTTP/1.1 200 OK\r\n" ) c.http_connect(to) @@ -243,7 +243,7 @@ class TestDaemon(_TestDaemon): def test_socks_connect(self): to = ("foobar", 80) c = pathoc.Pathoc(("127.0.0.1", self.d.port), fp=None) - c.rfile, c.wfile = tutils.treader(""), cStringIO.StringIO() + c.rfile, c.wfile = tutils.treader(""), StringIO() tutils.raises(pathoc.PathocError, c.socks_connect, to) c.rfile = tutils.treader( |