diff options
author | Dariusz Smigiel <dsmigiel@redhat.com> | 2022-06-15 09:26:20 -0700 |
---|---|---|
committer | Dariusz Smigiel <dsmigiel@redhat.com> | 2022-06-15 10:11:27 -0700 |
commit | d05c388078b45285ac4a012c568a5e2d56556a34 (patch) | |
tree | 3747cd86eef46411b016168b7123a8251702d58b /tests | |
parent | 49294a6a7cb6e9ece1c1814d629e2d9e497180fa (diff) | |
download | oauthlib-d05c388078b45285ac4a012c568a5e2d56556a34.tar.gz |
Removed dependency on split
Diffstat (limited to 'tests')
-rw-r--r-- | tests/oauth1/rfc5849/test_signatures.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/oauth1/rfc5849/test_signatures.py b/tests/oauth1/rfc5849/test_signatures.py index 3e84f24..e737e68 100644 --- a/tests/oauth1/rfc5849/test_signatures.py +++ b/tests/oauth1/rfc5849/test_signatures.py @@ -240,6 +240,26 @@ class SignatureTests(TestCase): base_string_uri('http:///path', 'OVERRIDE.example.com')) # ---------------- + # Host: valid host allows for IPv4 and IPv6 + + self.assertEqual( + 'https://192.168.0.1/', + base_string_uri('https://192.168.0.1') + ) + self.assertEqual( + 'https://192.168.0.1:13000/', + base_string_uri('https://192.168.0.1:13000') + ) + self.assertEqual( + 'https://[123:db8:fd00:1000::5]:13000/', + base_string_uri('https://[123:db8:fd00:1000::5]:13000') + ) + self.assertEqual( + 'https://[123:db8:fd00:1000::5]/', + base_string_uri('https://[123:db8:fd00:1000::5]') + ) + + # ---------------- # Port: default ports always excluded; non-default ports always included self.assertEqual( @@ -339,7 +359,6 @@ class SignatureTests(TestCase): self.assertRaises(ValueError, base_string_uri, 'http://:8080') # Port is not a valid TCP/IP port number - self.assertRaises(ValueError, base_string_uri, 'http://eg.com:0') self.assertRaises(ValueError, base_string_uri, 'http://eg.com:-1') self.assertRaises(ValueError, base_string_uri, 'http://eg.com:65536') self.assertRaises(ValueError, base_string_uri, 'http://eg.com:3.14') |