From c3ad68c88a5c7eab2c70fa3a58aab547f60f61e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 5 May 2008 17:47:06 +0000 Subject: Fix Unicode filename test. --- Lib/test/test_zipfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index ace5a88..c83622a 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -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): -- cgit v0.12