diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-25 14:42:15 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-25 14:42:15 +1200 |
commit | 353efec7ce032a447efbba60c5ccea441bc573fb (patch) | |
tree | 3f443161fc6ac18caa30ddf30d4965cd8643d478 /test/test_tcp.py | |
parent | 47f862ae278c61df9bd1b62ec291a954fc0707ea (diff) | |
download | mitmproxy-353efec7ce032a447efbba60c5ccea441bc573fb.tar.gz mitmproxy-353efec7ce032a447efbba60c5ccea441bc573fb.tar.bz2 mitmproxy-353efec7ce032a447efbba60c5ccea441bc573fb.zip |
Improve TCPClient interface.
- Don't pass SSL parameters on instantiation.
- Add a convert_to_ssl method analogous to that in TCPServer.
Diffstat (limited to 'test/test_tcp.py')
-rw-r--r-- | test/test_tcp.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_tcp.py b/test/test_tcp.py index 1bad9a04..26286bc4 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -66,7 +66,7 @@ class TestServer(ServerTestBase): def test_echo(self): testval = "echo!\n" - c = tcp.TCPClient(False, "127.0.0.1", self.port, None) + c = tcp.TCPClient("127.0.0.1", self.port) c.connect() c.wfile.write(testval) c.wfile.flush() @@ -82,8 +82,9 @@ class TestServerSSL(ServerTestBase): return s def test_echo(self): - c = tcp.TCPClient(True, "127.0.0.1", self.port, None) + c = tcp.TCPClient("127.0.0.1", self.port) c.connect() + c.convert_to_ssl() testval = "echo!\n" c.wfile.write(testval) c.wfile.flush() @@ -92,7 +93,7 @@ class TestServerSSL(ServerTestBase): class TestTCPClient: def test_conerr(self): - c = tcp.TCPClient(True, "127.0.0.1", 0, None) + c = tcp.TCPClient("127.0.0.1", 0) tutils.raises(tcp.NetLibError, c.connect) |