@@ -189,6 +189,9 @@ def test_roundtrips(self):
189
189
('////path/to/file' ,
190
190
('' , '' , '//path/to/file' , '' , '' , '' ),
191
191
('' , '' , '//path/to/file' , '' , '' )),
192
+ ('/////path/to/file' ,
193
+ ('' , '' , '///path/to/file' , '' , '' , '' ),
194
+ ('' , '' , '///path/to/file' , '' , '' )),
192
195
('scheme:path/to/file' ,
193
196
('scheme' , '' , 'path/to/file' , '' , '' , '' ),
194
197
('scheme' , '' , 'path/to/file' , '' , '' )),
@@ -201,6 +204,9 @@ def test_roundtrips(self):
201
204
('scheme:////path/to/file' ,
202
205
('scheme' , '' , '//path/to/file' , '' , '' , '' ),
203
206
('scheme' , '' , '//path/to/file' , '' , '' )),
207
+ ('scheme://///path/to/file' ,
208
+ ('scheme' , '' , '///path/to/file' , '' , '' , '' ),
209
+ ('scheme' , '' , '///path/to/file' , '' , '' )),
204
210
('file:///tmp/junk.txt' ,
205
211
('file' , '' , '/tmp/junk.txt' , '' , '' , '' ),
206
212
('file' , '' , '/tmp/junk.txt' , '' , '' )),
@@ -236,12 +242,23 @@ def test_roundtrips(self):
236
242
'action=download-manifest&url=https://example.com/app' , '' ),
237
243
('itms-services' , '' , '' ,
238
244
'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' , '' , '' )),
239
251
]
240
252
def _encode (t ):
241
253
return (t [0 ].encode ('ascii' ),
242
254
tuple (x .encode ('ascii' ) for x in t [1 ]),
243
255
tuple (x .encode ('ascii' ) for x in t [2 ]))
244
256
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
+ ]
245
262
for url , parsed , split in str_cases + bytes_cases :
246
263
self .checkRoundtrips (url , parsed , split )
247
264
0 commit comments