mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
Fix Unicode filename test.
This commit is contained in:
parent
471617d6d3
commit
c3ad68c88a
1 changed files with 6 additions and 4 deletions
|
|
@ -556,11 +556,13 @@ class OtherTests(unittest.TestCase):
|
||||||
def testUnicodeFilenames(self):
|
def testUnicodeFilenames(self):
|
||||||
zf = zipfile.ZipFile(TESTFN, "w")
|
zf = zipfile.ZipFile(TESTFN, "w")
|
||||||
zf.writestr(u"foo.txt", "Test for unicode filename")
|
zf.writestr(u"foo.txt", "Test for unicode filename")
|
||||||
zf.writestr(u"fo\xf6.txt", "Test for unicode filename")
|
zf.writestr(u"\xf6.txt", "Test for unicode filename")
|
||||||
assert isinstance(zf.infolist()[0].filename, unicode)
|
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.close()
|
||||||
zf = zipfile.ZipFile(TESTFN, "w")
|
|
||||||
|
|
||||||
|
|
||||||
def testCreateNonExistentFileForAppend(self):
|
def testCreateNonExistentFileForAppend(self):
|
||||||
if os.path.exists(TESTFN):
|
if os.path.exists(TESTFN):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue