aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r--test/test_proxy.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 371e5ef7..737e4a92 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -19,25 +19,26 @@ class TestServerConnection:
self.d.shutdown()
def test_simple(self):
- sc = proxy.ServerConnection(proxy.ProxyConfig(), "http", self.d.IFACE, self.d.port, "host.com")
+ sc = proxy.ServerConnection((self.d.IFACE, self.d.port))
sc.connect()
r = tutils.treq()
r.path = "/p/200:da"
- sc.send(r)
+ sc.send(r._assemble())
assert http.read_response(sc.rfile, r.method, 1000)
assert self.d.last_log()
r.content = flow.CONTENT_MISSING
- tutils.raises("incomplete request", sc.send, r)
+ tutils.raises("incomplete request", sc.send, r._assemble())
- sc.terminate()
+ sc.finish()
def test_terminate_error(self):
- sc = proxy.ServerConnection(proxy.ProxyConfig(), "http", self.d.IFACE, self.d.port, "host.com")
+ sc = proxy.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=tcp.NetLibDisconnect)
- sc.terminate()
+ sc.finish()
class MockParser: