From 88375ad64aa2f53b9447df1ccd7aa7ee77cb04ef Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 21 Sep 2015 02:26:47 +0200 Subject: fix minor bugs, add py.test compatibility --- test/test_proxy.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/test_proxy.py') 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() -- cgit v1.2.3