Kaydet (Commit) c3ad68c8 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Fix Unicode filename test.

üst 471617d6
......@@ -556,11 +556,13 @@ class OtherTests(unittest.TestCase):
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, "r")
self.assertEqual(zf.filelist[0].filename, "foo.txt")
self.assertEqual(zf.filelist[1].filename, u"\xf6.txt")
zf.close()
zf = zipfile.ZipFile(TESTFN, "w")
def testCreateNonExistentFileForAppend(self):
if os.path.exists(TESTFN):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment