From 62116848f2eb6ee25f0547b17ebc27c3030761d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 8 May 2006 08:18:49 +0000 Subject: [PATCH] * test stored --- tests/zipfileexttests.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/zipfileexttests.py b/tests/zipfileexttests.py index e747b12f..3ea7e598 100644 --- a/tests/zipfileexttests.py +++ b/tests/zipfileexttests.py @@ -33,13 +33,20 @@ class ZipFileExtCase(testcase.TestCase): f.write(str) return str - def testDeflateZipUnzip(self): + def genericTestZipUnzip(self, compress_type): str = self.makeRandomFile('tmp/random') zipfile = ZipFile('tmp/test.zip', 'w') - zipfile.write('tmp/random', compress_type = ZIP_DEFLATED) + zipfile.write('tmp/random', compress_type = compress_type) zipfile.close() zipfile2 = ZipFile('tmp/test.zip', 'r') str2 = zipfile2.read('tmp/random') self.assertEqual(str, str2) + def testStoredZipUnzip(self): + self.genericTestZipUnzip(ZIP_STORED) + + def testDeflateZipUnzip(self): + self.genericTestZipUnzip(ZIP_DEFLATED) + + suite = unittest.makeSuite(ZipFileExtCase)