diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-26 00:39:04 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-26 00:39:04 +0200 |
commit | 106f7046d3862cb0e3cbb4f38335af0330b4e7e3 (patch) | |
tree | 6a57a7c29062cad851d0b162a17e460b32ea3262 /test/http/http1/test_assemble.py | |
parent | 45f2ea33b2fdb67ca89e7eedd860ebe683770497 (diff) | |
download | mitmproxy-106f7046d3862cb0e3cbb4f38335af0330b4e7e3.tar.gz mitmproxy-106f7046d3862cb0e3cbb4f38335af0330b4e7e3.tar.bz2 mitmproxy-106f7046d3862cb0e3cbb4f38335af0330b4e7e3.zip |
refactor request model
Diffstat (limited to 'test/http/http1/test_assemble.py')
-rw-r--r-- | test/http/http1/test_assemble.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/http/http1/test_assemble.py b/test/http/http1/test_assemble.py index 963e7549..47d11d33 100644 --- a/test/http/http1/test_assemble.py +++ b/test/http/http1/test_assemble.py @@ -20,7 +20,7 @@ def test_assemble_request(): ) with raises(HttpException): - assemble_request(treq(body=CONTENT_MISSING)) + assemble_request(treq(content=CONTENT_MISSING)) def test_assemble_request_head(): @@ -62,21 +62,21 @@ def test_assemble_body(): def test_assemble_request_line(): - assert _assemble_request_line(treq()) == b"GET /path HTTP/1.1" + assert _assemble_request_line(treq().data) == b"GET /path HTTP/1.1" - authority_request = treq(method=b"CONNECT", form_in="authority") + authority_request = treq(method=b"CONNECT", first_line_format="authority").data assert _assemble_request_line(authority_request) == b"CONNECT address:22 HTTP/1.1" - absolute_request = treq(form_in="absolute") + absolute_request = treq(first_line_format="absolute").data assert _assemble_request_line(absolute_request) == b"GET http://address:22/path HTTP/1.1" with raises(RuntimeError): - _assemble_request_line(treq(), "invalid_form") + _assemble_request_line(treq(first_line_format="invalid_form").data) def test_assemble_request_headers(): # https://github.com/mitmproxy/mitmproxy/issues/186 - r = treq(body=b"") + r = treq(content=b"") r.headers["Transfer-Encoding"] = "chunked" c = _assemble_request_headers(r) assert b"Transfer-Encoding" in c |