[Python-checkins] r73872 - python/branches/py3k/Lib/test/test_zipfile.py

gregory.p.smith python-checkins at python.org
Tue Jul 7 07:06:04 CEST 2009


Author: gregory.p.smith
Date: Tue Jul  7 07:06:04 2009
New Revision: 73872

Log:
Add a unittest for r73566.


Modified:
   python/branches/py3k/Lib/test/test_zipfile.py

Modified: python/branches/py3k/Lib/test/test_zipfile.py
==============================================================================
--- python/branches/py3k/Lib/test/test_zipfile.py	(original)
+++ python/branches/py3k/Lib/test/test_zipfile.py	Tue Jul  7 07:06:04 2009
@@ -379,6 +379,14 @@
         for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
             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):
         os.remove(TESTFN)
         os.remove(TESTFN2)


More information about the Python-checkins mailing list