aboutsummaryrefslogtreecommitdiffstats
path: root/test/pathod/test_pathoc.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-17 16:38:31 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-17 16:45:45 +1300
commitce98a9219e060b729d4b0d2dc28bf4510649f0fd (patch)
treec5be5cc8d53de169aadd7c30c4ad41b55b79c783 /test/pathod/test_pathoc.py
parent839813a84c3d63ca44d2721f6cb39b79c489195a (diff)
downloadmitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.tar.gz
mitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.tar.bz2
mitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.zip
test & examples: zap six
Diffstat (limited to 'test/pathod/test_pathoc.py')
-rw-r--r--test/pathod/test_pathoc.py15
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(