Increase the coverage of macurl2path. Patch by Colin Williams.

This commit is contained in:
Senthil Kumaran 2013-10-23 21:50:56 -07:00
parent a1782e1be8
commit b82a3dc240
4 changed files with 34 additions and 21 deletions

View file

@ -75,23 +75,3 @@ def pathname2url(pathname):
def _pncomp2url(component):
# We want to quote slashes
return urllib.parse.quote(component[:31], safe='')
def test():
for url in ["index.html",
"bar/index.html",
"/foo/bar/index.html",
"/foo/bar/",
"/"]:
print('%r -> %r' % (url, url2pathname(url)))
for path in ["drive:",
"drive:dir:",
"drive:dir:file",
"drive:file",
"file",
":file",
":dir:",
":dir:file"]:
print('%r -> %r' % (path, pathname2url(path)))
if __name__ == '__main__':
test()