summaryrefslogtreecommitdiff
path: root/tests/oauth1/rfc5849/test_signatures.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oauth1/rfc5849/test_signatures.py')
-rw-r--r--tests/oauth1/rfc5849/test_signatures.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/oauth1/rfc5849/test_signatures.py b/tests/oauth1/rfc5849/test_signatures.py
index 8d4ce85..4abf914 100644
--- a/tests/oauth1/rfc5849/test_signatures.py
+++ b/tests/oauth1/rfc5849/test_signatures.py
@@ -83,8 +83,24 @@ class SignatureTests(TestCase):
uri = b"www.example.com:8080"
self.assertRaises(ValueError, normalize_base_string_uri, uri)
- uri = "http://www.example.com:80"
- self.assertEquals(normalize_base_string_uri(uri), "http://www.example.com")
+ # test a URI with the default port
+ uri = "http://www.example.com:80/"
+ self.assertEquals(normalize_base_string_uri(uri), "http://www.example.com/")
+
+ # test a URI missing a path
+ uri = "http://www.example.com"
+ self.assertEquals(normalize_base_string_uri(uri), "http://www.example.com/")
+
+ # test a relative URI
+ uri = "/a-host-relative-uri"
+ host = "www.example.com"
+ self.assertRaises(ValueError, normalize_base_string_uri, (uri, host))
+
+ # test overriding the URI's netloc with a host argument
+ uri = "http://www.example.com/a-path"
+ host = "alternatehost.example.com"
+ self.assertEquals(normalize_base_string_uri(uri, host),
+ "http://alternatehost.example.com/a-path")
def test_collect_parameters(self):
""" We check against parameters multiple times in case things change after more