aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-08-21 10:26:28 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-08-21 10:26:28 +0200
commit05d26545e4c65e8fd2242142833a40a96ce5fb81 (patch)
tree7a004316b39ba3c791966934bf835a95617209dc /test
parent55cfd259dc8264ca9bca166b50b0d3dc7ab71451 (diff)
downloadmitmproxy-05d26545e4c65e8fd2242142833a40a96ce5fb81.tar.gz
mitmproxy-05d26545e4c65e8fd2242142833a40a96ce5fb81.tar.bz2
mitmproxy-05d26545e4c65e8fd2242142833a40a96ce5fb81.zip
adapt netlib changes
Diffstat (limited to 'test')
-rw-r--r--test/test_protocol_http.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index c6a9159c..940d6c7a 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -4,6 +4,7 @@ from cStringIO import StringIO
from mock import MagicMock
from libmproxy.protocol.http import *
+import netlib.http
from netlib import odict
from netlib.http import http1
from netlib.http.semantics import CONTENT_MISSING
@@ -27,19 +28,19 @@ class TestHTTPResponse:
"\r\n"
protocol = mock_protocol(s)
- r = HTTPResponse.from_protocol(protocol, "GET")
+ r = HTTPResponse.from_protocol(protocol, netlib.http.EmptyRequest(method="GET"))
assert r.status_code == 200
assert r.content == "content"
- assert HTTPResponse.from_protocol(protocol, "GET").status_code == 204
+ assert HTTPResponse.from_protocol(protocol, netlib.http.EmptyRequest(method="GET")).status_code == 204
protocol = mock_protocol(s)
# HEAD must not have content by spec. We should leave it on the pipe.
- r = HTTPResponse.from_protocol(protocol, "HEAD")
+ r = HTTPResponse.from_protocol(protocol, netlib.http.EmptyRequest(method="HEAD"))
assert r.status_code == 200
assert r.content == ""
tutils.raises(
"Invalid server response: 'content",
- HTTPResponse.from_protocol, protocol, "GET"
+ HTTPResponse.from_protocol, protocol, netlib.http.EmptyRequest(method="GET")
)