summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-14 14:16:27 (GMT)
committerGitHub <noreply@github.com>2024-05-14 14:16:27 (GMT)
commit56cc026c85c9962b610a9fd19de4ceda50cfa2e5 (patch)
tree5a01b9d5bdd26ad7507463baa12c22525b00f5b4 /Lib/test
parent387ff96e95b9f8a8cc7e646523ba3175b1350669 (diff)
downloadcpython-56cc026c85c9962b610a9fd19de4ceda50cfa2e5.zip
cpython-56cc026c85c9962b610a9fd19de4ceda50cfa2e5.tar.gz
cpython-56cc026c85c9962b610a9fd19de4ceda50cfa2e5.tar.bz2
[3.12] Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031) (GH-119036)
(cherry picked from commit 331d385af9817eaa32b739130227781358f85771) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urlparse.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 2cf03d0..4faad73 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -189,6 +189,9 @@ class UrlParseTestCase(unittest.TestCase):
('////path/to/file',
('', '', '//path/to/file', '', '', ''),
('', '', '//path/to/file', '', '')),
+ ('/////path/to/file',
+ ('', '', '///path/to/file', '', '', ''),
+ ('', '', '///path/to/file', '', '')),
('scheme:path/to/file',
('scheme', '', 'path/to/file', '', '', ''),
('scheme', '', 'path/to/file', '', '')),
@@ -201,6 +204,9 @@ class UrlParseTestCase(unittest.TestCase):
('scheme:////path/to/file',
('scheme', '', '//path/to/file', '', '', ''),
('scheme', '', '//path/to/file', '', '')),
+ ('scheme://///path/to/file',
+ ('scheme', '', '///path/to/file', '', '', ''),
+ ('scheme', '', '///path/to/file', '', '')),
('file:///tmp/junk.txt',
('file', '', '/tmp/junk.txt', '', '', ''),
('file', '', '/tmp/junk.txt', '', '')),
@@ -236,12 +242,23 @@ class UrlParseTestCase(unittest.TestCase):
'action=download-manifest&url=https://example.com/app', ''),
('itms-services', '', '',
'action=download-manifest&url=https://example.com/app', '')),
+ ('+scheme:path/to/file',
+ ('', '', '+scheme:path/to/file', '', '', ''),
+ ('', '', '+scheme:path/to/file', '', '')),
+ ('sch_me:path/to/file',
+ ('', '', 'sch_me:path/to/file', '', '', ''),
+ ('', '', 'sch_me:path/to/file', '', '')),
]
def _encode(t):
return (t[0].encode('ascii'),
tuple(x.encode('ascii') for x in t[1]),
tuple(x.encode('ascii') for x in t[2]))
bytes_cases = [_encode(x) for x in str_cases]
+ str_cases += [
+ ('schème:path/to/file',
+ ('', '', 'schème:path/to/file', '', '', ''),
+ ('', '', 'schème:path/to/file', '', '')),
+ ]
for url, parsed, split in str_cases + bytes_cases:
self.checkRoundtrips(url, parsed, split)