diff options
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 7bf383f6bc..e7e54a2dd8 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -5,6 +5,7 @@ import httplib import unittest from test import test_support import os +import sys import mimetools import tempfile import StringIO @@ -630,6 +631,23 @@ class Pathname_Tests(unittest.TestCase): "url2pathname() failed; %s != %s" % (expect, result)) + @unittest.skipUnless(sys.platform == 'win32', + 'test specific to the nturl2path library') + def test_ntpath(self): + given = ('/C:/', '///C:/', '/C|//') + expect = 'C:\\' + for url in given: + result = urllib.url2pathname(url) + self.assertEqual(expect, result, + 'nturl2path.url2pathname() failed; %s != %s' % + (expect, result)) + given = '///C|/path' + expect = 'C:\\path' + result = urllib.url2pathname(given) + self.assertEqual(expect, result, + 'nturl2path.url2pathname() failed; %s != %s' % + (expect, result)) + class Utility_Tests(unittest.TestCase): """Testcase to test the various utility functions in the urllib.""" |