diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-16 02:02:40 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-16 02:02:40 +0100 |
commit | 2d569527f29f2d6b0c7c9e10e509a6822b69ee4f (patch) | |
tree | 716765da657fad75b031fefc5bfdf8e1d5cfc81b /test | |
parent | bc7db1be2d3b330bb515703659af43d5154eeb14 (diff) | |
parent | 718e298dba59fda841e18c464c6a208660760c05 (diff) | |
download | mitmproxy-2d569527f29f2d6b0c7c9e10e509a6822b69ee4f.tar.gz mitmproxy-2d569527f29f2d6b0c7c9e10e509a6822b69ee4f.tar.bz2 mitmproxy-2d569527f29f2d6b0c7c9e10e509a6822b69ee4f.zip |
Merge branch 'master' of https://github.com/mitmproxy/mitmproxy
Diffstat (limited to 'test')
-rw-r--r-- | test/netlib/http/test_request.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py index 900b2cd1..7a6a9665 100644 --- a/test/netlib/http/test_request.py +++ b/test/netlib/http/test_request.py @@ -136,8 +136,10 @@ class TestRequestUtils(object): assert request.query.lst == [("bar", "42")] def test_set_query(self): - request = treq() + request = treq(host=b"foo", headers = Headers(host=b"bar")) request.query = ODict([]) + assert request.host == b"foo" + assert request.headers["host"] == b"bar" def test_get_cookies_none(self): request = treq() @@ -180,11 +182,14 @@ class TestRequestUtils(object): assert request.path_components == ["foo", "bar"] def test_set_path_components(self): - request = treq() + request = treq(host=b"foo", headers = Headers(host=b"bar")) request.path_components = ["foo", "baz"] assert request.path == "/foo/baz" request.path_components = [] assert request.path == "/" + request.query = ODict([]) + assert request.host == b"foo" + assert request.headers["host"] == b"bar" def test_anticache(self): request = treq() |