aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_proxy.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-16 18:45:22 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-16 18:45:22 +0200
commit0af060897854e0e0fc8207af02d22bec9eacab12 (patch)
tree8f5206386bb481a813f1b6891c30d5d2d33924ba /test/test_proxy.py
parent436a9ea8398e25709f139fde609aa74e8fb3f3f8 (diff)
downloadmitmproxy-0af060897854e0e0fc8207af02d22bec9eacab12.tar.gz
mitmproxy-0af060897854e0e0fc8207af02d22bec9eacab12.tar.bz2
mitmproxy-0af060897854e0e0fc8207af02d22bec9eacab12.zip
adjust to netlib changes
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r--test/test_proxy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 3707fabe..76d8758c 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -9,6 +9,7 @@ from libmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler
import tutils
from libpathod import test
from netlib import http, tcp
+from netlib.http import http1
class TestServerConnection:
@@ -26,11 +27,10 @@ class TestServerConnection:
f.request.path = "/p/200:da"
# use this protocol just to assemble - not for actual sending
- protocol = http.http1.HTTP1Protocol(rfile=sc.rfile)
- sc.send(protocol.assemble(f.request))
+ sc.wfile.write(http1.assemble_request(f.request))
+ sc.wfile.flush()
- protocol = http.http1.HTTP1Protocol(rfile=sc.rfile)
- assert protocol.read_response(f.request.method, 1000)
+ assert http1.read_response(sc.rfile, f.request, 1000)
assert self.d.last_log()
sc.finish()