aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_proxy.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-21 02:26:47 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-21 02:26:47 +0200
commit88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef (patch)
treed8bb3f92ae9b32fc9bbc33b85789d50fb6c45515 /test/test_proxy.py
parent6d27901b6fe44a651788e07d9e2de4d367be925e (diff)
downloadmitmproxy-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.py11
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()