diff options
Diffstat (limited to 'test/netlib/http/test_request.py')
-rw-r--r-- | test/netlib/http/test_request.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py index 50ad2d05..91fd8ce3 100644 --- a/test/netlib/http/test_request.py +++ b/test/netlib/http/test_request.py @@ -107,6 +107,14 @@ class TestRequestUtils(object): with raises(ValueError): request.url = "not-a-url" + def test_url_options(self): + request = treq(method="OPTIONS", path="*") + assert request.url == "http://address:22" + + def test_url_authority(self): + request = treq(first_line_format="authority") + assert request.url == "address:22" + def test_pretty_host(self): request = treq() # Without host header @@ -140,6 +148,10 @@ class TestRequestUtils(object): request.headers["host"] = "other" assert request.pretty_url == "http://address:22/path" + def test_pretty_url_options(self): + request = treq(method="OPTIONS", path="*") + assert request.pretty_url == "http://address:22" + def test_pretty_url_authority(self): request = treq(first_line_format="authority") assert request.pretty_url == "address:22" |