From d3b1a74d574b78bef05264a55a2145e043bdfe2e Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Mon, 24 Apr 2017 11:42:36 +0200 Subject: [PATCH] call info-zip's unzzip for comparison in testsuite --- test/zziptests.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/zziptests.py b/test/zziptests.py index cbd90f0..f58c034 100644 --- a/test/zziptests.py +++ b/test/zziptests.py @@ -518,6 +518,39 @@ class ZZipTest(unittest.TestCase): ##################################################################### # check unzzip ##################################################################### + def test_400_infozip_cat_test0_zip(self): + """ run inzo-zip cat test.zip using just archive README """ + zipfile = "test0.zip" + getfile = "README" + logfile = "test0.readme.big.txt" + exe = self.bins("unzip") + run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) + self.assertGreater(os.path.getsize(logfile), 10) + self.assertEqual(run.output.split("\n"), self.readme().split("\n")) + def test_401_infozip_cat_test1_zip(self): + """ run info-zip cat test.zip using just archive README """ + zipfile = "test1.zip" + getfile = "README" + logfile = "test1.readme.big.txt" + exe = self.bins("unzip") + run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) + self.assertGreater(os.path.getsize(logfile), 10) + self.assertEqual(run.output.split("\n"), self.readme().split("\n")) + getfile = "file.1" + run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) + self.assertEqual("file-1\n", run.output) + def test_402_infozip_cat_test2_zip(self): + """ run info-zip cat test.zip using just archive README """ + zipfile = "test2.zip" + getfile = "README" + logfile = "test2.readme.big.txt" + exe = self.bins("unzip") + run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) + self.assertGreater(os.path.getsize(logfile), 10) + self.assertEqual(run.output.split("\n"), self.readme().split("\n")) + getfile = "file.22" + run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) + self.assertEqual("file-22\n", run.output) def test_410_zzcat_big_test0_zip(self): """ run zzcat-big on test.zip using just archive README """ zipfile = "test0.zip" -- 2.40.0