diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-10-17 17:03:02 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-17 17:03:02 +1300 |
commit | ae3ff8ee1edc646e7a640219df1a312c27f7c339 (patch) | |
tree | 490697113ceaf12cc704c418357139e60a0190f3 /test/pathod/test_pathoc.py | |
parent | 3fbce7e981cab5d20b3ef17a50f14b34e8c60fa3 (diff) | |
parent | ce98a9219e060b729d4b0d2dc28bf4510649f0fd (diff) | |
download | mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.tar.gz mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.tar.bz2 mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.zip |
Merge pull request #1615 from cortesi/python3a
exterminate six
Diffstat (limited to 'test/pathod/test_pathoc.py')
-rw-r--r-- | test/pathod/test_pathoc.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 361a863b..f9670d73 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -1,5 +1,4 @@ -from six.moves import cStringIO as StringIO -from six import BytesIO +import io from mock import Mock from netlib import http @@ -21,7 +20,7 @@ def test_response(): class PathocTestDaemon(tutils.DaemonTests): def tval(self, requests, timeout=None, showssl=False, **kwargs): - s = StringIO() + s = io.StringIO() c = pathoc.Pathoc( ("127.0.0.1", self.d.port), ssl=self.ssl, @@ -71,7 +70,7 @@ class TestDaemonSSL(PathocTestDaemon): assert log[0]["request"]["clientcert"]["keyinfo"] def test_http2_without_ssl(self): - fp = StringIO() + fp = io.StringIO() c = pathoc.Pathoc( ("127.0.0.1", self.d.port), use_http2=True, @@ -171,15 +170,15 @@ class TestDaemon(PathocTestDaemon): def test_connect_fail(self): to = ("foobar", 80) c = pathoc.Pathoc(("127.0.0.1", self.d.port), fp=None) - c.rfile, c.wfile = BytesIO(), BytesIO() + c.rfile, c.wfile = io.BytesIO(), io.BytesIO() with raises("connect failed"): c.http_connect(to) - c.rfile = BytesIO( + c.rfile = io.BytesIO( b"HTTP/1.1 500 OK\r\n" ) with raises("connect failed"): c.http_connect(to) - c.rfile = BytesIO( + c.rfile = io.BytesIO( b"HTTP/1.1 200 OK\r\n" ) c.http_connect(to) @@ -187,7 +186,7 @@ class TestDaemon(PathocTestDaemon): 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(b""), BytesIO() + c.rfile, c.wfile = tutils.treader(b""), io.BytesIO() tutils.raises(pathoc.PathocError, c.socks_connect, to) c.rfile = tutils.treader( |