Skip to content

Commit 56cc026

Browse files
[3.12] Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031) (GH-119036)
(cherry picked from commit 331d385) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 387ff96 commit 56cc026

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Lib/test/test_urlparse.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ def test_roundtrips(self):
189189
('////path/to/file',
190190
('', '', '//path/to/file', '', '', ''),
191191
('', '', '//path/to/file', '', '')),
192+
('/////path/to/file',
193+
('', '', '///path/to/file', '', '', ''),
194+
('', '', '///path/to/file', '', '')),
192195
('scheme:path/to/file',
193196
('scheme', '', 'path/to/file', '', '', ''),
194197
('scheme', '', 'path/to/file', '', '')),
@@ -201,6 +204,9 @@ def test_roundtrips(self):
201204
('scheme:////path/to/file',
202205
('scheme', '', '//path/to/file', '', '', ''),
203206
('scheme', '', '//path/to/file', '', '')),
207+
('scheme://///path/to/file',
208+
('scheme', '', '///path/to/file', '', '', ''),
209+
('scheme', '', '///path/to/file', '', '')),
204210
('file:///tmp/junk.txt',
205211
('file', '', '/tmp/junk.txt', '', '', ''),
206212
('file', '', '/tmp/junk.txt', '', '')),
@@ -236,12 +242,23 @@ def test_roundtrips(self):
236242
'action=download-manifest&url=https://example.com/app', ''),
237243
('itms-services', '', '',
238244
'action=download-manifest&url=https://example.com/app', '')),
245+
('+scheme:path/to/file',
246+
('', '', '+scheme:path/to/file', '', '', ''),
247+
('', '', '+scheme:path/to/file', '', '')),
248+
('sch_me:path/to/file',
249+
('', '', 'sch_me:path/to/file', '', '', ''),
250+
('', '', 'sch_me:path/to/file', '', '')),
239251
]
240252
def _encode(t):
241253
return (t[0].encode('ascii'),
242254
tuple(x.encode('ascii') for x in t[1]),
243255
tuple(x.encode('ascii') for x in t[2]))
244256
bytes_cases = [_encode(x) for x in str_cases]
257+
str_cases += [
258+
('schème:path/to/file',
259+
('', '', 'schème:path/to/file', '', '', ''),
260+
('', '', 'schème:path/to/file', '', '')),
261+
]
245262
for url, parsed, split in str_cases + bytes_cases:
246263
self.checkRoundtrips(url, parsed, split)
247264

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy