summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urlparse.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2019-10-18 13:07:20 (GMT)
committerSenthil Kumaran <skumaran@gatech.edu>2019-10-18 13:07:20 (GMT)
commit5a88d50ff013a64fbdb25b877c87644a9034c969 (patch)
tree48ee40eae4bce36fadf31bca4790f097ac65e999 /Lib/test/test_urlparse.py
parentfbe3c76c7ce1eec887d332d801d3784212cc0f73 (diff)
downloadcpython-5a88d50ff013a64fbdb25b877c87644a9034c969.zip
cpython-5a88d50ff013a64fbdb25b877c87644a9034c969.tar.gz
cpython-5a88d50ff013a64fbdb25b877c87644a9034c969.tar.bz2
bpo-27657: Fix urlparse() with numeric paths (#661)
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r--Lib/test/test_urlparse.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 4ae6ed3..7625007 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -709,15 +709,17 @@ class UrlParseTestCase(unittest.TestCase):
def test_portseparator(self):
# Issue 754016 makes changes for port separator ':' from scheme separator
- self.assertEqual(urllib.parse.urlparse("path:80"),
- ('','','path:80','','',''))
+ self.assertEqual(urllib.parse.urlparse("http:80"), ('http','','80','','',''))
+ self.assertEqual(urllib.parse.urlparse("https:80"), ('https','','80','','',''))
+ self.assertEqual(urllib.parse.urlparse("path:80"), ('path','','80','','',''))
self.assertEqual(urllib.parse.urlparse("http:"),('http','','','','',''))
self.assertEqual(urllib.parse.urlparse("https:"),('https','','','','',''))
self.assertEqual(urllib.parse.urlparse("http://www.python.org:80"),
('http','www.python.org:80','','','',''))
# As usual, need to check bytes input as well
- self.assertEqual(urllib.parse.urlparse(b"path:80"),
- (b'',b'',b'path:80',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"http:80"), (b'http',b'',b'80',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"https:80"), (b'https',b'',b'80',b'',b'',b''))
+ self.assertEqual(urllib.parse.urlparse(b"path:80"), (b'path',b'',b'80',b'',b'',b''))
self.assertEqual(urllib.parse.urlparse(b"http:"),(b'http',b'',b'',b'',b'',b''))
self.assertEqual(urllib.parse.urlparse(b"https:"),(b'https',b'',b'',b'',b'',b''))
self.assertEqual(urllib.parse.urlparse(b"http://www.python.org:80"),