From 0c391205ec0b925c77b05bd6376085d01f91f8c7 Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Mon, 24 Apr 2017 01:14:17 +0200 Subject: [PATCH] align tests big/mem --- test/zziptests.py | 93 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 24 deletions(-) diff --git a/test/zziptests.py b/test/zziptests.py index a281e29..7389cdd 100644 --- a/test/zziptests.py +++ b/test/zziptests.py @@ -514,20 +514,20 @@ class ZZipTest(unittest.TestCase): run = shell("{exe} {getfile}".format(**locals())) self.assertEqual("file-999\n", run.output) - def test_400_zzcat_seeko_test0_zip(self): - """ run zzcat-seeko on test.zip using just archive README """ + def test_400_zzcat_big_test0_zip(self): + """ run zzcat-big on test.zip using just archive README """ zipfile = "test0.zip" getfile = "README" - logfile = "test0.readme.seeko.txt" + logfile = "test0.readme.big.txt" exe = self.bins("unzzip-big") 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_zzcat_seeko_test1_zip(self): - """ run zzcat-seeko on test.zip using just archive README """ + def test_401_zzcat_big_test1_zip(self): + """ run zzcat-big on test.zip using just archive README """ zipfile = "test1.zip" getfile = "README" - logfile = "test1.readme.seeko.txt" + logfile = "test1.readme.big.txt" exe = self.bins("unzzip-big") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -535,11 +535,11 @@ class ZZipTest(unittest.TestCase): getfile = "file.1" run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) self.assertEqual("file-1\n", run.output) - def test_402_zzcat_seeko_seeko_test2_zip(self): + def test_402_zzcat_big_test2_zip(self): """ run zzcat-seeke on test.zip using just archive README """ zipfile = "test2.zip" getfile = "README" - logfile = "test2.readme.seeko.txt" + logfile = "test2.readme.big.txt" exe = self.bins("unzzip-big") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -551,16 +551,16 @@ class ZZipTest(unittest.TestCase): """ run zzcat-mem on test.zip using just archive README """ zipfile = "test0.zip" getfile = "README" - logfile = "test0.readme.mmapped.txt" + logfile = "test0.readme.mem.txt" exe = self.bins("unzzip-mem") 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_411_zzcat_test1_zip(self): + def test_411_zzcat_mem_test1_zip(self): """ run zzcat-mem on test.zip using archive README """ zipfile = "test1.zip" getfile = "README" - logfile = "test1.readme.mmapped.txt" + logfile = "test1.readme.mem.txt" exe = self.bins("unzzip-mem") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -568,11 +568,11 @@ class ZZipTest(unittest.TestCase): getfile = "file.1" run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertEqual("file-1\n", run.output) - def test_412_zzcat_test2_zip(self): + def test_412_zzcat_mem_test2_zip(self): """ run zzcat-mem on test.zip using archive README """ zipfile = "test2.zip" getfile = "README" - logfile = "test2.readme.mmapped.txt" + logfile = "test2.readme.mem.txt" exe = self.bins("unzzip-mem") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -580,11 +580,11 @@ class ZZipTest(unittest.TestCase): getfile = "file.22" run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) self.assertEqual("file-22\n", run.output) - def test_413_zzcat_test3_zip(self): + def test_413_zzcat_mem_test3_zip(self): """ run zzcat-mem on test.zip using archive README """ zipfile = "test3.zip" getfile = "README" - logfile = "test3.readme.mmapped.txt" + logfile = "test3.readme.mem.txt" exe = self.bins("unzzip-mem") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -592,11 +592,11 @@ class ZZipTest(unittest.TestCase): getfile = "file.999" run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) self.assertEqual("file-999\n", run.output) - def test_414_zzcat_test4_zip(self): + def test_414_zzcat_mem_test4_zip(self): """ run zzcat-mem on test.zip using archive README """ zipfile = "test4.zip" getfile = "README" - logfile = "test4.readme.mmapped.txt" + logfile = "test4.readme.mem.txt" exe = self.bins("unzzip-mem") run = shell("{exe} -p {zipfile} {getfile} | tee {logfile}".format(**locals())) self.assertGreater(os.path.getsize(logfile), 10) @@ -604,8 +604,53 @@ class ZZipTest(unittest.TestCase): getfile = "file.999" run = shell("{exe} -p {zipfile} {getfile}".format(**locals())) self.assertEqual("file-999\n", run.output) - def test_420_zzdir_test0_zip(self): - """ run zzdir-me on test0.zip """ + def test_500_zzdir_big_test0_zip(self): + """ run zzdir-big on test0.zip """ + zipfile = "test0.zip" + getfile = "test0.zip" + exe = self.bins("unzzip-big") + run = shell("{exe} -l {getfile} ".format(**locals())) + self.assertIn(' README ', run.output) + self.assertLess(len(run.output), 30) + def test_501_zzdir_big_test1_zip(self): + """ run zzdir-big on test1.zip """ + zipfile = "test1.zip" + getfile = "test1.zip" + exe = self.bins("unzzip-big") + run = shell("{exe} -l {getfile} ".format(**locals())) + self.assertIn(' file.1 ', run.output) + self.assertIn(' file.2 ', run.output) + self.assertIn(' file.9 ', run.output) + self.assertIn(' README ', run.output) + def test_502_zzdir_big_test2_zip(self): + """ run zzdir-big on test2.zip """ + zipfile = "test2.zip" + getfile = "test2.zip" + exe = self.bins("unzzip-big") + run = shell("{exe} -l {getfile} ".format(**locals())) + self.assertIn(' file.01 ', run.output) + self.assertIn(' file.22 ', run.output) + self.assertIn(' file.99 ', run.output) + def test_503_zzdir_big_test3_zip(self): + """ run zzdir-big on test3.zip """ + zipfile = "test3.zip" + getfile = "test3.zip" + exe = self.bins("unzzip-big") + run = shell("{exe} -l {getfile} ".format(**locals())) + self.assertIn(' file.001 ', run.output) + self.assertIn(' file.222 ', run.output) + self.assertIn(' file.999 ', run.output) + def test_504_zzdir_big_test4_zip(self): + """ run zzdir-big on test4.zip """ + zipfile = "test4.zip" + getfile = "test4.zip" + exe = self.bins("unzzip-big") + run = shell("{exe} -l {getfile} ".format(**locals())) + self.assertIn(' file.001 ', run.output) + self.assertIn(' file.222 ', run.output) + self.assertIn(' file.999 ', run.output) + def test_510_zzdir_mem_test0_zip(self): + """ run zzdir-mem on test0.zip """ zipfile = "test0.zip" getfile = "test0.zip" exe = self.bins("unzzip-mem") @@ -613,7 +658,7 @@ class ZZipTest(unittest.TestCase): self.assertIn(' README ', run.output) self.assertIn(' deflated ', run.output) self.assertLess(len(run.output), 30) - def test_421_zzdir_test1_zip(self): + def test_511_zzdir_mem_test1_zip(self): """ run zzdir-mem on test1.zip """ zipfile = "test1.zip" getfile = "test1.zip" @@ -625,7 +670,7 @@ class ZZipTest(unittest.TestCase): self.assertIn(' README ', run.output) self.assertIn(' deflated ', run.output) self.assertIn(' stored ', run.output) - def test_422_zzdir_test2_zip(self): + def test_512_zzdir_mem_test2_zip(self): """ run zzdir-mem on test2.zip """ zipfile = "test2.zip" getfile = "test2.zip" @@ -636,7 +681,7 @@ class ZZipTest(unittest.TestCase): self.assertIn(' file.99 ', run.output) self.assertIn(' deflated ', run.output) self.assertIn(' stored ', run.output) - def test_423_zzdir_test3_zip(self): + def test_513_zzdir_mem_test3_zip(self): """ run zzdir-mem on test3.zip """ zipfile = "test3.zip" getfile = "test3.zip" @@ -647,7 +692,7 @@ class ZZipTest(unittest.TestCase): self.assertIn(' file.999 ', run.output) self.assertIn(' deflated ', run.output) self.assertIn(' stored ', run.output) - def test_424_zzdir_test4_zip(self): + def test_514_zzdir_mem_test4_zip(self): """ run zzdir-mem on test4.zip """ zipfile = "test4.zip" getfile = "test4.zip" @@ -659,7 +704,7 @@ class ZZipTest(unittest.TestCase): self.assertNotIn(' deflated ', run.output) self.assertIn(' stored ', run.output) - def test_500_make_test1w_zip(self): + def test_900_make_test1w_zip(self): """ create a test1w.zip using zzip/write functions. """ exe=self.bins("zzip") run = shell("{exe} --version".format(**locals())) -- 2.40.0