Commits

Martin von Löwis committed 10e8ef9

Fix Unicode filename test.

Comments (0)

Files changed (1)

Lib/test/test_zipfile.py

     def testUnicodeFilenames(self):
         zf = zipfile.ZipFile(TESTFN, "w")
         zf.writestr(u"foo.txt", "Test for unicode filename")
-        zf.writestr(u"fo\xf6.txt", "Test for unicode filename")
-        assert isinstance(zf.infolist()[0].filename, unicode)
+        zf.writestr(u"\xf6.txt", "Test for unicode filename")
+        self.assertTrue(isinstance(zf.infolist()[0].filename, unicode))
         zf.close()
-        zf = zipfile.ZipFile(TESTFN, "w")
-
+        zf = zipfile.ZipFile(TESTFN, "r")
+        self.assertEqual(zf.filelist[0].filename, "foo.txt")
+        self.assertEqual(zf.filelist[1].filename, u"\xf6.txt")
+        zf.close()
 
     def testCreateNonExistentFileForAppend(self):
         if os.path.exists(TESTFN):