]> granicus.if.org Git - python/commitdiff
Add a test for normpath to test_macpath.
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 27 Feb 2010 12:42:52 +0000 (12:42 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 27 Feb 2010 12:42:52 +0000 (12:42 +0000)
Lib/test/test_macpath.py

index f477ddb42bb89d216976e2869a1a0486d0ce33f1..564def72b2c3a7e0f03a7be35277e539a23e7847 100644 (file)
@@ -61,6 +61,12 @@ class MacPathTestCase(unittest.TestCase):
         self.assertEqual(splitext(""), ('', ''))
         self.assertEqual(splitext("foo.bar.ext"), ('foo.bar', '.ext'))
 
+    def test_normpath(self):
+        # Issue 5827: Make sure normpath preserves unicode
+        for path in (u'', u'.', u'/', u'\\', u':', u'///foo/.//bar//'):
+            self.assertIsInstance(macpath.normpath(path), unicode,
+                                  'normpath() returned str instead of unicode')
+
 
 def test_main():
     test_support.run_unittest(MacPathTestCase)