diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pathoc.py | 15 | ||||
-rw-r--r-- | test/test_pathod.py | 4 | ||||
-rw-r--r-- | test/tutils.py | 2 |
3 files changed, 9 insertions, 12 deletions
diff --git a/test/test_pathoc.py b/test/test_pathoc.py index 7493b2e7..d96a1728 100644 --- a/test/test_pathoc.py +++ b/test/test_pathoc.py @@ -27,8 +27,7 @@ class _TestDaemon: def test_info(self): c = pathoc.Pathoc( - "127.0.0.1", - self.d.port, + ("127.0.0.1", self.d.port), ssl = self.ssl ) c.connect() @@ -41,8 +40,7 @@ class TestDaemonSSL(_TestDaemon): ssloptions = pathod.SSLOptions(request_client_cert=True) def test_sni(self): c = pathoc.Pathoc( - "127.0.0.1", - self.d.port, + ("127.0.0.1", self.d.port), ssl = True, sni = "foobar.com" ) @@ -54,8 +52,7 @@ class TestDaemonSSL(_TestDaemon): def test_clientcert(self): c = pathoc.Pathoc( - "127.0.0.1", - self.d.port, + ("127.0.0.1", self.d.port), ssl = True, clientcert = tutils.test_data.path("data/clientcert/client.pem") ) @@ -69,7 +66,7 @@ class TestDaemonSSL(_TestDaemon): class TestDaemon(_TestDaemon): ssl = False def tval(self, requests, showreq=False, showresp=False, explain=False, hexdump=False, timeout=None, ignorecodes=None, ignoretimeout=None): - c = pathoc.Pathoc("127.0.0.1", self.d.port) + c = pathoc.Pathoc(("127.0.0.1", self.d.port)) c.connect() if timeout: c.settimeout(timeout) @@ -88,7 +85,7 @@ class TestDaemon(_TestDaemon): return s.getvalue() def test_ssl_error(self): - c = pathoc.Pathoc("127.0.0.1", self.d.port, ssl = True) + c = pathoc.Pathoc(("127.0.0.1", self.d.port), ssl = True) tutils.raises("ssl handshake", c.connect) def test_ignorecodes(self): @@ -135,7 +132,7 @@ class TestDaemon(_TestDaemon): def test_connect_fail(self): to = ("foobar", 80) - c = pathoc.Pathoc("127.0.0.1", self.d.port) + c = pathoc.Pathoc(("127.0.0.1", self.d.port)) c.rfile, c.wfile = cStringIO.StringIO(), cStringIO.StringIO() tutils.raises("connect failed", c.http_connect, to) c.rfile = cStringIO.StringIO( diff --git a/test/test_pathod.py b/test/test_pathod.py index 9cd90e94..9ab6d66d 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -120,7 +120,7 @@ class CommonTests(tutils.DaemonTests): assert rsp.status_code == 202 def test_invalid_first_line(self): - c = tcp.TCPClient("localhost", self.d.port) + c = tcp.TCPClient(("localhost", self.d.port)) c.connect() if self.ssl: c.convert_to_ssl() @@ -169,7 +169,7 @@ class TestDaemon(CommonTests): class TestDaemonSSL(CommonTests): ssl = True def test_ssl_conn_failure(self): - c = tcp.TCPClient("localhost", self.d.port) + c = tcp.TCPClient(("localhost", self.d.port)) c.rbufsize = 0 c.wbufsize = 0 c.connect() diff --git a/test/tutils.py b/test/tutils.py index 59649053..1baf16e2 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -50,7 +50,7 @@ class DaemonTests: def pathoc(self, spec, timeout=None, connect_to=None, ssl=None): if ssl is None: ssl = self.ssl - c = pathoc.Pathoc("localhost", self.d.port, ssl=ssl) + c = pathoc.Pathoc(("localhost", self.d.port), ssl=ssl) c.connect(connect_to) if timeout: c.settimeout(timeout) |