diff options
author | Коренберг Марк <socketpair@gmail.com> | 2017-12-21 12:16:17 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2017-12-21 12:16:17 (GMT) |
commit | fbd605151fcf2899b14575f4ddb9ce3c55e684ab (patch) | |
tree | 33c8d17b6cc9fd44c5471860c16b7fdc02e67eaa /Lib/test | |
parent | a8d25a16452f7ee8dfc350cd028b3ae172d28ada (diff) | |
download | cpython-fbd605151fcf2899b14575f4ddb9ce3c55e684ab.zip cpython-fbd605151fcf2899b14575f4ddb9ce3c55e684ab.tar.gz cpython-fbd605151fcf2899b14575f4ddb9ce3c55e684ab.tar.bz2 |
bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (#4867)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urlparse.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index e5f6130..ddee1c3 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -520,6 +520,15 @@ class UrlParseTestCase(unittest.TestCase): self.assertEqual(result.url, defrag) self.assertEqual(result.fragment, frag) + def test_urlsplit_scoped_IPv6(self): + p = urllib.parse.urlsplit('http://[FE80::822a:a8ff:fe49:470c%tESt]:1234') + self.assertEqual(p.hostname, "fe80::822a:a8ff:fe49:470c%tESt") + self.assertEqual(p.netloc, '[FE80::822a:a8ff:fe49:470c%tESt]:1234') + + p = urllib.parse.urlsplit(b'http://[FE80::822a:a8ff:fe49:470c%tESt]:1234') + self.assertEqual(p.hostname, b"fe80::822a:a8ff:fe49:470c%tESt") + self.assertEqual(p.netloc, b'[FE80::822a:a8ff:fe49:470c%tESt]:1234') + def test_urlsplit_attributes(self): url = "HTTP://WWW.PYTHON.ORG/doc/#frag" p = urllib.parse.urlsplit(url) |