mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Fixup more tests
This commit is contained in:
parent
9dc1224282
commit
d6ab9901d1
@ -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"
|
||||
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user