diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-21 11:11:16 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-21 11:11:16 +1200 |
commit | dd7ea896f24514bb2534b3762255e99f0aabc055 (patch) | |
tree | 4d1fec09dd03336b8b85040ebf90e437069f4d34 /test/test_http.py | |
parent | 2c660d76337b11eb438a2978ec3bda3ac10babd5 (diff) | |
download | mitmproxy-dd7ea896f24514bb2534b3762255e99f0aabc055.tar.gz mitmproxy-dd7ea896f24514bb2534b3762255e99f0aabc055.tar.bz2 mitmproxy-dd7ea896f24514bb2534b3762255e99f0aabc055.zip |
Return a named tuple from read_response
Diffstat (limited to 'test/test_http.py')
-rw-r--r-- | test/test_http.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_http.py b/test/test_http.py index 5bd7cab2..4f8ef2c5 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -254,15 +254,17 @@ class TestReadResponseNoContentLength(test.ServerTestBase): def test_no_content_length(self): c = tcp.TCPClient(("127.0.0.1", self.port)) c.connect() - httpversion, code, msg, headers, content = http.read_response(c.rfile, "GET", None) - assert content == "bar\r\n\r\n" + resp = http.read_response(c.rfile, "GET", None) + assert resp.content == "bar\r\n\r\n" def test_read_response(): def tst(data, method, limit, include_body=True): data = textwrap.dedent(data) r = cStringIO.StringIO(data) - return http.read_response(r, method, limit, include_body = include_body) + return http.read_response( + r, method, limit, include_body = include_body + ) tutils.raises("server disconnect", tst, "", "GET", None) tutils.raises("invalid server response", tst, "foo", "GET", None) |