Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a7be0ae

Browse filesBrowse files
serhiy-storchakamiss-islington
authored andcommitted
Add yet few cases for urlparse/urlunparse roundtrip tests (pythonGH-119031)
Add yet few cases for urlparse/urlunparse tests (cherry picked from commit 331d385) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 387ff96 commit a7be0ae
Copy full SHA for a7be0ae

File tree

Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed

‎Lib/test/test_urlparse.py

Copy file name to clipboardExpand all lines: Lib/test/test_urlparse.py
+17Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.