diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-22 13:04:45 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-22 15:30:12 +0200 |
commit | cedc0407de2fc4018c3d1852fc5678d532dc8e6e (patch) | |
tree | c6c8ecdf96c0808cd5feb75a5804773e34d018db /test/test_server.py | |
parent | bb265d0c407a635bc0eb6357648897e3ecaf0013 (diff) | |
download | mitmproxy-cedc0407de2fc4018c3d1852fc5678d532dc8e6e.tar.gz mitmproxy-cedc0407de2fc4018c3d1852fc5678d532dc8e6e.tar.bz2 mitmproxy-cedc0407de2fc4018c3d1852fc5678d532dc8e6e.zip |
refactor to use netlib.http protocols
Diffstat (limited to 'test/test_server.py')
-rw-r--r-- | test/test_server.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_server.py b/test/test_server.py index 8d773957..10822ae4 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -184,6 +184,9 @@ class TcpMixin: class AppMixin: def test_app(self): ret = self.app("/") + print(ret) + print(ret.status_code) + print(ret.content) assert ret.status_code == 200 assert "mitmproxy" in ret.content @@ -767,16 +770,15 @@ class TestStreamRequest(tservers.HTTPProxTest): (self.server.urlbase, spec)) connection.send("\r\n") - resp = http.http1.read_response(fconn, "GET", None, include_body=False) + protocol = http.http1.HTTP1Protocol(rfile=fconn) + resp = protocol.read_response("GET", None, include_body=False) assert resp.headers["Transfer-Encoding"][0] == 'chunked' assert resp.status_code == 200 chunks = list( - content for _, - content, - _ in http.http1.read_http_body_chunked( - fconn, resp.headers, None, "GET", 200, False)) + content for _, content, _ in protocol.read_http_body_chunked( + resp.headers, None, "GET", 200, False)) assert chunks == ["this", "isatest", ""] connection.close() |