aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-02-18 21:58:32 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-02-18 21:58:32 +0530
commitd6ab9901d1f4d330a624b1a41d86d8d03c910b7a (patch)
tree9edc48584b13b7ace4cd299dce9b7ca62e52be41 /test
parent9dc12242822d0361cdf25ba2a2bb6e17dbd35eb6 (diff)
downloadmitmproxy-d6ab9901d1f4d330a624b1a41d86d8d03c910b7a.tar.gz
mitmproxy-d6ab9901d1f4d330a624b1a41d86d8d03c910b7a.tar.bz2
mitmproxy-d6ab9901d1f4d330a624b1a41d86d8d03c910b7a.zip
Fixup more tests
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_flow.py2
-rw-r--r--test/netlib/http/test_request.py11
2 files changed, 8 insertions, 5 deletions
diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py
index a593c8c3..13ced265 100644
--- a/test/mitmproxy/test_flow.py
+++ b/test/mitmproxy/test_flow.py
@@ -1035,7 +1035,7 @@ class TestRequest:
assert r.url == "https://address:22/path"
assert r.pretty_url == "https://address:22/path"
- r.headers["Host"] = "foo.com"
+ r.headers["Host"] = "foo.com:22"
assert r.url == "https://address:22/path"
assert r.pretty_url == "https://foo.com:22/path"
diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py
index 350b5405..5672259e 100644
--- a/test/netlib/http/test_request.py
+++ b/test/netlib/http/test_request.py
@@ -110,7 +110,7 @@ class TestRequestUtils(object):
# Same port as self.port (22)
request.headers["host"] = "other:22"
assert request.pretty_host == "other"
- # Different Ports
+ # Different ports
request.headers["host"] = "other"
assert request.pretty_host == "address"
assert request.host == "address"
@@ -125,12 +125,15 @@ class TestRequestUtils(object):
def test_pretty_url(self):
request = treq()
+ # Without host header
assert request.url == "http://address:22/path"
assert request.pretty_url == "http://address:22/path"
- request.headers["host"] = "other"
+ # Same port as self.port (22)
+ request.headers["host"] = "other:22"
assert request.pretty_url == "http://other:22/path"
- request.headers["host"] = "other:33"
- assert request.pretty_url == "http://other:33/path"
+ # Different ports
+ request.headers["host"] = "other"
+ assert request.pretty_url == "http://address:22/path"
def test_pretty_url_authority(self):
request = treq(first_line_format="authority")