Add a unittest for r73566.

This commit is contained in:
Gregory P. Smith 2009-07-07 05:06:04 +00:00
parent 097cd072c0
commit b0d9ca9258
1 changed files with 8 additions and 0 deletions

View File

@ -379,6 +379,14 @@ class TestsWithSourceFile(unittest.TestCase):
for f in (TESTFN2, TemporaryFile(), io.BytesIO()): for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
self.zip_test_writestr_permissions(f, zipfile.ZIP_STORED) self.zip_test_writestr_permissions(f, zipfile.ZIP_STORED)
def test_writestr_extended_local_header_issue1202(self):
orig_zip = zipfile.ZipFile(TESTFN2, 'w')
for data in 'abcdefghijklmnop':
zinfo = zipfile.ZipInfo(data)
zinfo.flag_bits |= 0x08 # Include an extended local header.
orig_zip.writestr(zinfo, data)
orig_zip.close()
def tearDown(self): def tearDown(self):
os.remove(TESTFN) os.remove(TESTFN)
os.remove(TESTFN2) os.remove(TESTFN2)