From 0c3b6ee667f6a73ae3ebd84b68c09cbf092c509c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 3 Sep 2014 17:33:08 +0200 Subject: fix IOError handling --- test/test_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/test_server.py') diff --git a/test/test_server.py b/test/test_server.py index a570f10f..3125c2f3 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -112,7 +112,10 @@ class TestHTTP(tservers.HTTPProxTest, CommonMixin, AppMixin): # Tests a difficult-to-trigger condition, where an IOError is raised # within our read loop. with mock.patch("libmproxy.protocol.http.HTTPRequest.from_stream") as m: - m.side_effect = IOError("error!") + def brk(f, *args, **kwargs): + f.o._sock.close() + raise IOError("error!") + m.side_effect = brk tutils.raises("server disconnect", self.pathod, "304") def test_get_connection_switching(self): -- cgit v1.2.3