diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-21 02:26:47 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-21 02:26:47 +0200 |
commit | 88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef (patch) | |
tree | d8bb3f92ae9b32fc9bbc33b85789d50fb6c45515 /test/test_proxy.py | |
parent | 6d27901b6fe44a651788e07d9e2de4d367be925e (diff) | |
download | mitmproxy-88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef.tar.gz mitmproxy-88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef.tar.bz2 mitmproxy-88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef.zip |
fix minor bugs, add py.test compatibility
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r-- | test/test_proxy.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py index 172613aa..57ad606d 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -13,14 +13,10 @@ from netlib import http, tcp from netlib.http import http1 -class TestServerConnection: - def setUp(self): - self.d = test.Daemon() - - def tearDown(self): - self.d.shutdown() +class TestServerConnection(object): def test_simple(self): + self.d = test.Daemon() sc = ServerConnection((self.d.IFACE, self.d.port)) sc.connect() f = tutils.tflow() @@ -35,14 +31,17 @@ class TestServerConnection: assert self.d.last_log() sc.finish() + self.d.shutdown() def test_terminate_error(self): + self.d = test.Daemon() sc = ServerConnection((self.d.IFACE, self.d.port)) sc.connect() sc.connection = mock.Mock() sc.connection.recv = mock.Mock(return_value=False) sc.connection.flush = mock.Mock(side_effect=TcpDisconnect) sc.finish() + self.d.shutdown() def test_repr(self): sc = tutils.tserver_conn() |