pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/331d385af9817eaa32b739130227781358f85771

9241e157469407.css" /> Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031) · python/cpython@331d385 · GitHub
Skip to content

Commit 331d385

Browse files
Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031)
Add yet few cases for urlparse/urlunparse tests
1 parent e237b25 commit 331d385

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
('//github.com//path/to/file',
190190
('', '', '//path/to/file', '', '', ''),
191191
('', '', '//path/to/file', '', '')),
192+
('//github.com///path/to/file',
193+
('', '', '//github.com/path/to/file', '', '', ''),
194+
('', '', '//github.com/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://github.com//path/to/file',
202205
('scheme', '', '//path/to/file', '', '', ''),
203206
('scheme', '', '//path/to/file', '', '')),
207+
('scheme://github.com///path/to/file',
208+
('scheme', '', '//github.com/path/to/file', '', '', ''),
209+
('scheme', '', '//github.com/path/to/file', '', '')),
204210
('file://github.com/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 © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

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