From 88d365cfe671bc5c8d96e78334337aa84cc815da Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 20 Mar 2016 19:40:03 +0100 Subject: py3++: cStringIO --- test/pathod/test_pathoc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/pathod/test_pathoc.py') 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( -- cgit v1.2.3