diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-14 05:20:41 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-14 05:20:41 (GMT) |
commit | 99e97f92c6b4993275fc84b76018374281467e91 (patch) | |
tree | 78d54cd6a2302f5defa17090ba5a0e454bbfc9a9 /Lib/test/test_urllib.py | |
parent | c470a0c744d484b707cc14bc92883bb2ee8c32c8 (diff) | |
parent | 56f1e2d875109c9f9bef2d3c065a5218d1a9485b (diff) | |
download | cpython-99e97f92c6b4993275fc84b76018374281467e91.zip cpython-99e97f92c6b4993275fc84b76018374281467e91.tar.gz cpython-99e97f92c6b4993275fc84b76018374281467e91.tar.bz2 |
merge from 3.2.
Fix closes Issue1147.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 526760d..2775a13 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -9,6 +9,7 @@ import io import unittest from test import support import os +import sys import tempfile def hexescape(char): @@ -1021,6 +1022,23 @@ class Pathname_Tests(unittest.TestCase): "url2pathname() failed; %s != %s" % (expect, result)) + @unittest.skipUnless(sys.platform == 'win32', + 'test specific to the urllib.url2path function.') + def test_ntpath(self): + given = ('/C:/', '///C:/', '/C|//') + expect = 'C:\\' + for url in given: + result = urllib.request.url2pathname(url) + self.assertEqual(expect, result, + 'urllib.request..url2pathname() failed; %s != %s' % + (expect, result)) + given = '///C|/path' + expect = 'C:\\path' + result = urllib.request.url2pathname(given) + self.assertEqual(expect, result, + 'urllib.request.url2pathname() failed; %s != %s' % + (expect, result)) + class Utility_Tests(unittest.TestCase): """Testcase to test the various utility functions in the urllib.""" |