From df3863e1776fa97a5293f4c92e3dd8cca1dfec6f Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 24 May 2012 23:09:37 +0200 Subject: [PATCH] Improved tests. --- tests/__init__.py | 76 ++++++++++++++++++++--- tests/data/t .7z | Bin 158 -> 157 bytes tests/data/t .bz2 | Bin 40 -> 0 bytes tests/data/t .xz | Bin 60 -> 0 bytes tests/data/t.Z | Bin 375 -> 0 bytes tests/data/t.Z.foo | Bin 375 -> 0 bytes tests/data/t.a | 4 +- tests/data/t.a.foo | 4 +- tests/data/t.bz2.foo | Bin 40 -> 0 bytes tests/data/t.cpio | Bin 512 -> 512 bytes tests/data/t.cpio.foo | Bin 512 -> 512 bytes tests/data/t.gz | Bin 25 -> 0 bytes tests/data/t.gz.foo | Bin 25 -> 0 bytes tests/data/t.lha | Bin 111 -> 110 bytes tests/data/t.lha.foo | Bin 111 -> 110 bytes tests/data/t.lzma | Bin 21 -> 0 bytes tests/data/t.lzma.foo | Bin 21 -> 0 bytes tests/data/t.rar | Bin 111 -> 110 bytes tests/data/t.rar.foo | Bin 111 -> 110 bytes tests/data/t.tar | Bin 10240 -> 10240 bytes tests/data/t.tar.Z | Bin 285 -> 284 bytes tests/data/t.tar.Z.foo | Bin 285 -> 284 bytes tests/data/t.tar.bz2 | Bin 153 -> 152 bytes tests/data/t.tar.bz2.foo | Bin 153 -> 152 bytes tests/data/t.tar.foo | Bin 10240 -> 10240 bytes tests/data/t.tar.gz | Bin 151 -> 149 bytes tests/data/t.tar.gz.foo | Bin 151 -> 149 bytes tests/data/t.tar.lzma | Bin 147 -> 158 bytes tests/data/t.tar.lzma.foo | Bin 147 -> 158 bytes tests/data/t.tar.xz | Bin 200 -> 196 bytes tests/data/t.tar.xz.foo | Bin 200 -> 204 bytes tests/data/t.taz | Bin 151 -> 284 bytes tests/data/t.taz.foo | Bin 151 -> 284 bytes tests/data/t.tbz2 | Bin 153 -> 152 bytes tests/data/t.tbz2.foo | Bin 153 -> 152 bytes tests/data/t.tgz | Bin 151 -> 149 bytes tests/data/t.tgz.foo | Bin 151 -> 149 bytes tests/data/t.txt.Z | Bin 0 -> 6 bytes tests/data/t.txt.Z.foo | Bin 0 -> 6 bytes tests/data/t.txt.bz2 | Bin 0 -> 37 bytes tests/data/t.txt.bz2.foo | Bin 0 -> 37 bytes tests/data/t.txt.gz | Bin 29 -> 28 bytes tests/data/t.txt.gz.foo | Bin 29 -> 28 bytes tests/data/t.txt.lz | Bin 39 -> 38 bytes tests/data/t.txt.lzma | Bin 0 -> 25 bytes tests/data/t.txt.lzma.foo | Bin 0 -> 25 bytes tests/data/t.txt.xz | Bin 0 -> 60 bytes tests/data/t.zip | Bin 299 -> 194 bytes tests/data/t.zip.foo | Bin 299 -> 194 bytes tests/test_archives.py | 119 ++++++++++++++++++------------------- tests/test_foo_archives.py | 65 ++++++++++---------- 51 files changed, 162 insertions(+), 106 deletions(-) delete mode 100644 tests/data/t .bz2 delete mode 100644 tests/data/t .xz delete mode 100644 tests/data/t.Z delete mode 100644 tests/data/t.Z.foo delete mode 100644 tests/data/t.bz2.foo delete mode 100644 tests/data/t.gz delete mode 100644 tests/data/t.gz.foo delete mode 100644 tests/data/t.lzma delete mode 100644 tests/data/t.lzma.foo create mode 100644 tests/data/t.txt.Z create mode 100644 tests/data/t.txt.Z.foo create mode 100644 tests/data/t.txt.bz2 create mode 100644 tests/data/t.txt.bz2.foo create mode 100644 tests/data/t.txt.lzma create mode 100644 tests/data/t.txt.lzma.foo create mode 100644 tests/data/t.txt.xz diff --git a/tests/__init__.py b/tests/__init__.py index 7d8a7e8..6c8be8a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -19,6 +19,27 @@ import shutil import nose import patoolib +# All text files have '42' as content. +TextFileContent = '42' + +class ContentSet: + """The test archives have one of several set of content files. + The different content file sets have each a constant defined + by this class. + """ + + # Recursive archives for extraction have a text file in a directory: + # t/t.txt + # Recursive archives for creation have two text files in directories: + # foo dir/t.txt + # foo dir/bar/t.txt + Recursive = 'recursive' + + # Singlefile archives for extraction have a text file t.txt + # Recursive archives for creation have a text file `foo .txt' + Singlefile = 'singlefile' + + basedir = os.path.dirname(__file__) datadir = os.path.join(basedir, 'data') @@ -36,12 +57,24 @@ class ArchiveTest (unittest.TestCase): All keyword arguments are delegated to the create test function.""" self.archive_list(filename) self.archive_test(filename) - self.archive_extract(filename) + if kwargs.get('singlefile'): + contents_default = ContentSet.Singlefile + else: + contents_default = ContentSet.Recursive + contents = kwargs.get('contents', contents_default) + self.archive_extract(filename, contents=contents) self.archive_create(filename, **kwargs) - def archive_extract (self, filename): + def archive_extract (self, filename, contents=ContentSet.Recursive): """Test archive extraction.""" archive = os.path.join(datadir, filename) + self.assertTrue(os.path.isabs(archive), "archive path is not absolute: %r" % archive) + self._archive_extract(archive, contents) + # archive name relative to tmpdir + relarchive = os.path.join("..", archive[len(basedir)+1:]) + self._archive_extract(relarchive, contents, verbose=True) + + def _archive_extract (self, archive, contents, verbose=False): # create a temporary directory for extraction tmpdir = patoolib.util.tmpdir(dir=basedir) try: @@ -49,16 +82,34 @@ class ArchiveTest (unittest.TestCase): except OSError: olddir = None os.chdir(tmpdir) - # archive name relative to tmpdir - relarchive = os.path.join("..", archive[len(basedir)+1:]) try: - patoolib._handle_archive(archive, 'extract', program=self.program) - patoolib._handle_archive(relarchive, 'extract', program=self.program, verbose=True) + output = patoolib._handle_archive(archive, 'extract', program=self.program, verbose=verbose) + self.check_extracted_contents(archive, output, contents) finally: if olddir: os.chdir(olddir) shutil.rmtree(tmpdir) + def check_extracted_contents (self, archive, output, contents): + if contents == ContentSet.Recursive: + # outdir is the 't' directory of the archive + self.assertEqual(output, 't') + self.check_directory(output, 't') + txtfile = os.path.join(output, 't.txt') + self.check_textfile(txtfile, 't.txt') + elif contents == ContentSet.Singlefile: + txtfile = output + self.check_textfile(txtfile, 't.txt') + + def check_directory (self, dirname, expectedname): + self.assertTrue(os.path.isdir(dirname), dirname) + self.assertEqual(os.path.basename(dirname), expectedname) + + def check_textfile (self, filename, expectedname): + self.assertTrue(os.path.isfile(filename), filename) + self.assertEqual(os.path.basename(filename), expectedname) + self.assertEqual(get_filecontent(filename), TextFileContent) + def archive_list (self, filename): """Test archive listing.""" archive = os.path.join(datadir, filename) @@ -72,14 +123,16 @@ class ArchiveTest (unittest.TestCase): patoolib._handle_archive(archive, 'test', program=self.program, verbose=True) def archive_create (self, archive, srcfile=None, singlefile=False, - format=None, compression=None): + format=None, compression=None, contents=None): """Test archive creation.""" # determine filename which is added to the archive if srcfile is None: if singlefile: srcfile = 'foo .txt' + contents = ContentSet.Singlefile else: srcfile = 'foo dir' + contents = ContentSet.Recursive srcfile = os.path.join(datadir, srcfile) # The format and compression arguments are needed for creating # archives with unusual file extensions. @@ -92,6 +145,7 @@ class ArchiveTest (unittest.TestCase): # create again in verbose mode kwargs['verbose'] = True self._archive_create(archive, srcfile, kwargs) + # XXX check content def _archive_create (self, filename, topack, kwargs): """Create archive from filename.""" @@ -121,6 +175,14 @@ class ArchiveTest (unittest.TestCase): shutil.rmtree(tmpdir) +def get_filecontent(filename): + fo = open(filename) + try: + return fo.read() + finally: + fo.close() + + def needs_os (name): """Decorator skipping test if given program is not available.""" def check_prog (f): diff --git a/tests/data/t .7z b/tests/data/t .7z index 32772431a1b52a454a484b4eae79492e3b9adf15..7149c7fb954a92df91fd08c1db396f560800dea5 100644 GIT binary patch delta 144 zcmbQoIG3^BylT&Sbr}ZcbKAaOh-H8P1t`5XV+l8d6i*G9+i1+bj{lr$U7*vcVz2f? z3a8GU`JgJufBdZlgEK4Jx82`g=k$K~oV#Mm>PxEx?U~;<9{-o%*RzaAwU=>vM|#77 mvX^kGyaSRZk0Ht@`vwF%P#Z&9K1|-mE%)XBQoc-bF9a@I+ zHdn>n%}VaPc=LYqukuB+IoqR7Z_~PbocA?fzRUeLMy&tXq$ajUv524O{roj6DmUzp osON^_;G*-_3f9~V?YYc7-B8~jXr?$58^^>3akj`w2mBZq09CLxwEzGB diff --git a/tests/data/t .bz2 b/tests/data/t .bz2 deleted file mode 100644 index 99ca112240a0399a4fa77499b0bdd74353e2cc2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40 wcmZ>Y%CIzaj8qGby!NJdJ_7@z2LpqE2!jHH;ta{g#B!D3R!-i$6E{Bq0PXh-k^lez diff --git a/tests/data/t .xz b/tests/data/t .xz deleted file mode 100644 index 03545d7dee867c1e9f6c3875db87de09c56a19a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 zcmexsUKJ6=z`*kC+7>q^21Q0O1_p)_{ill=8JJ9rxEL5h!i?|SPEj#rV3cO&*54^0 PzwL7^BTx+kOJo!P`}hxE diff --git a/tests/data/t.Z b/tests/data/t.Z deleted file mode 100644 index e421820a88b0877bd13aa8ecd029aa8399e8977b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 375 zcmV--0f_z|osdl4$SKnXL>f4A>J%jNhK)cFbJEZO5vENUIxIkpdE;iz#fx?1Knz3X z;G8jO+?)YXhK)oy89kB#QL-WkHyjn_VVOown>RD*5QOtErJXcn>bRL$XCj+0Vg#09 zIgz2mfgsw1IpZb_MVE2vm^m}g)Dctm%s@98ai;akc}*Iv zoJYDDBlq!~i2(-|G^vngW04UjR=ij@H$j64ds}@NoT5dv8#{iK3!J1$lqy+nhM9J4 z8k;!X=;Y}WCA3dR4G%ZP^JD|j#VpHuVKK7C2JO~Oq$=d^;TSS)pZvLdC9R? z8GZc~Mqq;#2Et*tDOLw#SC#SDL}f@;24!tnhM7j2b@o|kqm_1AYI}LaS{Sau<`rSH V)yC3oAQ-n>atr+ikwnfBrvRf4A>J%jNhK)cFbJEZO5vENUIxIkpdE;iz#fx?1Knz3X z;G8jO+?)YXhK)oy89kB#QL-WkHyjn_VVOown>RD*5QOtErJXcn>bRL$XCj+0Vg#09 zIgz2mfgsw1IpZb_MVE2vm^m}g)Dctm%s@98ai;akc}*Iv zoJYDDBlq!~i2(-|G^vngW04UjR=ij@H$j64ds}@NoT5dv8#{iK3!J1$lqy+nhM9J4 z8k;!X=;Y}WCA3dR4G%ZP^JD|j#VpHuVKK7C2JO~Oq$=d^;TSS)pZvLdC9R? z8GZc~Mqq;#2Et*tDOLw#SC#SDL}f@;24!tnhM7j2b@o|kqm_1AYI}LaS{Sau<`rSH V)yC3oAQ-n>atr+ikwnfBrvR -t.txt 1337743924 501 20 100640 4 ` -foo +t.txt/ 1337890761 1000 1000 100640 2 ` +42 \ No newline at end of file diff --git a/tests/data/t.a.foo b/tests/data/t.a.foo index f40c3e9..2db6272 100644 --- a/tests/data/t.a.foo +++ b/tests/data/t.a.foo @@ -1,3 +1,3 @@ ! -t.txt 1337743924 501 20 100640 4 ` -foo +t.txt/ 1337890761 1000 1000 100640 2 ` +42 \ No newline at end of file diff --git a/tests/data/t.bz2.foo b/tests/data/t.bz2.foo deleted file mode 100644 index 99ca112240a0399a4fa77499b0bdd74353e2cc2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40 wcmZ>Y%CIzaj8qGby!NJdJ_7@z2LpqE2!jHH;ta{g#B!D3R!-i$6E{Bq0PXh-k^lez diff --git a/tests/data/t.cpio b/tests/data/t.cpio index 22709db928112a971ae42e14a3bcd9b9add7f1d7..15ce98cd07e62e85831dcaf800234ed3ea6065cc 100644 GIT binary patch literal 512 zcmX?J$oP*t;f3Q1<`>LN3=9l)-cw9KGy_8k!*QS-5A%XXkQ^geF3N-hNHZ~%=$Gh~ mRFp877#%MJsf7TL8W7+HlOaKlo<6QYii(P0?kF)RLjV8;))fx` delta 75 zcmZo*X<%_WUdaB>t?7m13+5NhObiSRb>34LN3=9l)-cw9KGy_8k!*QS-5A%XXkQ^geF3N-hNHZ~%=$Gh~ mRFp877#%MJsf7TL8W7+HlOaKlo<6QYii(P0?kF)RLjV8;))fx` delta 75 zcmZo*X<%_WUdaB>t?7m13+5NhObiSRb>34e8j|HsM&UrnSp@;08Oj~qW}N^ diff --git a/tests/data/t.gz.foo b/tests/data/t.gz.foo deleted file mode 100644 index 6434a262640aa9cfb575ab75d0ea7be8d7f980a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25 gcmb2|=HMtdt@CDJE@3b>e8j|HsM&UrnSp@;08Oj~qW}N^ diff --git a/tests/data/t.lha b/tests/data/t.lha index 0440693aba6ac9420b3ff0d6085e88eff4d77c72..9601df5d8566f15e49ac65611a7a307e4f37817e 100644 GIT binary patch delta 38 scmd1Ln_wa{NjE3MKv#-^fq@B#W$l7(6c|}c^hzp9ri)GtkY!{50Ig&QhX4Qo delta 39 tcmd1HpI{=Bs+*HxpexP5z`zW|vUb5X3XH5JdLG8^Snf%L7jn{fq{Vuh?zS!s2IuG1>49PvokDcWMC+XDbXvbC=ulTa%A57 Ndb9c8q9(d)0076B5*Yvh delta 59 zcmd1HpCDo^C{m)(pw7UG8^Snf%L7jn{fq{Vuh?zS!s2IuG1>49PvokDcWMC+XDbXvbC=ulTa%A57 Ndb9c8q9(d)0076B5*Yvh delta 59 zcmd1HpCDo^C{m)(pw7UL6-N*6BYOY D9@7g* delta 50 zcmZn&Xb9NQ#w2dcU}$J;Y;Iy~WN2)}U|?uyW@OBuU@+N`F=aC&Gb1A-*JeSM_sSC$ F_y91|3se9A diff --git a/tests/data/t.tar.Z b/tests/data/t.tar.Z index bb8e4ec1ec4f377182b4682c802a0945f0b28cb9..5cf39f0f876df76b1383c2605d7142478d4f4e06 100644 GIT binary patch delta 31 ncmbQsG>2(IJ-3UblIJWJ&1RK5TPJqOFh8)HH*sYl(|$$(u2(IJ-3UblIJWJ&1RK5TPJqOFh8)HH*sYl(|$$(u1 Gllx#+$~xZw literal 153 zcmV;K0A~L}T4*^jL0KkKS#$WZ{{R4{dxXJ|0Rlh)|9}7?XeA#&00ICAAOMjKA{ar5 zrhv(s2^14TWNDLX3`U-gcj-1(A#{6#&B4O0B&tn8}i#IT*BAb@a55MIQsP0;k~EHwIW7>A8y77!GhE0^;sSrwS4d He->Zhf}}bj diff --git a/tests/data/t.tar.bz2.foo b/tests/data/t.tar.bz2.foo index f4a0f05b1fc939c3433783a804c7af3932e58439..458c8fefa2fdb8f72a264ca826792b1ef28e5cf4 100644 GIT binary patch literal 152 zcmV;J0B8R~T4*^jL0KkKS*E1^*Z=^f`-H)O0Rcb(|9}7?XeA#&00ICAAOMjKAvDuX z9;S?d$+Qwe2{xlljDr&=vz@QDGbWH2RS6-yP+37}CKwDP4l;95&Z;aIH34U(MF7JG zmT|2K!m*xBqd@eS#EDCsPRxpQzPAzxN6_v$p}=Yz0~`eUo1p%|05b$YTwTc&;X*>1 Gllx#+$~xZw literal 153 zcmV;K0A~L}T4*^jL0KkKS#$WZ{{R4{dxXJ|0Rlh)|9}7?XeA#&00ICAAOMjKA{ar5 zrhv(s2^14TWNDLX3`U-gcj-1(A#{6#&B4O0B&tn8}i#IT*BAb@a55MIQsP0;k~EHwIW7>A8y77!GhE0^;sSrwS4d He->Zhf}}bj diff --git a/tests/data/t.tar.foo b/tests/data/t.tar.foo index 4f06ae97da4638dd7ef38876784eb125baf6b768..3adf9da87fcdedc53bb0b0ecef71334a3fa8ecb4 100644 GIT binary patch delta 48 zcmZn&Xb9NQ#w2dUU}$J;Y;Iy~WN2)}U|?uyW@N;mU@+N`F=aC&Gb7_>L6-N*6BYOY D9@7g* delta 50 zcmZn&Xb9NQ#w2dcU}$J;Y;Iy~WN2)}U|?uyW@OBuU@+N`F=aC&Gb1A-*JeSM_sSC$ F_y91|3se9A diff --git a/tests/data/t.tar.gz b/tests/data/t.tar.gz index e39819f466d34b7a9f9f185a4fa62c9cbc64e473..63a07011c041366094e705da6333796c0563a988 100644 GIT binary patch literal 149 zcmb2|=3qE6b)P>2^V^G#Tug>Mtq*0EsuxV!a(P~QfocbL@1u`%8A}ycD2NFD&!6nd zRQVxk!n=}dZn4X3&qy1d-Z}NnJJ%~)swSI!>sKqXIkLsy^V;QaTW;F!uipMY(C~=X yxr<+q2Nme9|Mk84|Fqh7_gC#!c{}UXtMkA0|Gi~lKn8ZDjI(~^HZf>0FaQA88b$^H literal 151 zcmb2|=3tm%Qs>RU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.tar.gz.foo b/tests/data/t.tar.gz.foo index e39819f466d34b7a9f9f185a4fa62c9cbc64e473..63a07011c041366094e705da6333796c0563a988 100644 GIT binary patch literal 149 zcmb2|=3qE6b)P>2^V^G#Tug>Mtq*0EsuxV!a(P~QfocbL@1u`%8A}ycD2NFD&!6nd zRQVxk!n=}dZn4X3&qy1d-Z}NnJJ%~)swSI!>sKqXIkLsy^V;QaTW;F!uipMY(C~=X yxr<+q2Nme9|Mk84|Fqh7_gC#!c{}UXtMkA0|Gi~lKn8ZDjI(~^HZf>0FaQA88b$^H literal 151 zcmb2|=3tm%Qs>RU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.tar.lzma b/tests/data/t.tar.lzma index 462abec94c672a0ab024c23868356f02934cf071..bc0e851640c0a9a66dd7fb8a4f10e5fc35899482 100644 GIT binary patch delta 101 zcmbQtIFFGxmVu#x;Xf2ihNG`Je9llb7qso{bH!UNe5+Q{A>bS;Rw!`+8Fh0|3+DC13ym diff --git a/tests/data/t.tar.lzma.foo b/tests/data/t.tar.lzma.foo index 462abec94c672a0ab024c23868356f02934cf071..bc0e851640c0a9a66dd7fb8a4f10e5fc35899482 100644 GIT binary patch delta 101 zcmbQtIFFGxmVu#x;Xf2ihNG`Je9llb7qso{bH!UNe5+Q{A>bS;Rw!`+8Fh0|3+DC13ym diff --git a/tests/data/t.tar.xz b/tests/data/t.tar.xz index 34fbdd48b879bba0e728c94d46e4bd09925dbd3b..e96f3478564960ade3f24013a892b7d5862e39a9 100644 GIT binary patch delta 101 zcmV-r0Gj{E0mK22907!p9Zp%oB%MS|J!O=gkX4D60Gy;=u@%~;+OKAzP`4be+j zT^`pb5F7MYQTH9Et@pKLf-zBpqcuPP>0J4N2{y9B00E!@fKUJc2z1P5vBYQl0ssI2 H00dcDsRJou delta 105 zcmX@Yc!F_)3}f3wS-;rR?~bwWDPVK9`w(z2!(Du}kddZuUrovCJ^%8ICrni#RV77(<2ySfi*zH(&>MH}|BF2UQ1_tJi#RV77(<2ySfi*zH(&>MH}|BF2UQ1_tJQZF$N49GHw6>QRAV_n>cgo1W;!VoiK7hfB-Ni3>!OX-0VD9^k~whP@_tn zO0}w0hXLuhpo53b)vsU)ezZYjW5kRVJ;Fe17NkTOB1xJ=DT5^3wJ~7A1z|C)-@iS7 z1|8ZIsnV&1pZ;CUxUplaG~hm-Ou4e<%a}83-pskP=g*)+iylq7wCU5RQ>$Lhy0z=q zuw%=fO}n=3+qiS<-p#wW@87_K3m;Crxbfr2lPh1&yt(t|(4$MAPQAMI>)5kv-_E_e i_wV4tiyu$Ey!rF!)2m<4zPRU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.taz.foo b/tests/data/t.taz.foo index e39819f466d34b7a9f9f185a4fa62c9cbc64e473..5cf39f0f876df76b1383c2605d7142478d4f4e06 100644 GIT binary patch literal 284 zcmV+%0ptE3ose{102oNHpuvL(6DnNDu%SbQFe1XZQ3D15i7_Zz#HjJ2#E%jI#E3Ct z#tj-XWT>QZF$N49GHw6>QRAV_n>cgo1W;!VoiK7hfB-Ni3>!OX-0VD9^k~whP@_tn zO0}w0hXLuhpo53b)vsU)ezZYjW5kRVJ;Fe17NkTOB1xJ=DT5^3wJ~7A1z|C)-@iS7 z1|8ZIsnV&1pZ;CUxUplaG~hm-Ou4e<%a}83-pskP=g*)+iylq7wCU5RQ>$Lhy0z=q zuw%=fO}n=3+qiS<-p#wW@87_K3m;Crxbfr2lPh1&yt(t|(4$MAPQAMI>)5kv-_E_e i_wV4tiyu$Ey!rF!)2m<4zPRU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.tbz2 b/tests/data/t.tbz2 index f4a0f05b1fc939c3433783a804c7af3932e58439..458c8fefa2fdb8f72a264ca826792b1ef28e5cf4 100644 GIT binary patch literal 152 zcmV;J0B8R~T4*^jL0KkKS*E1^*Z=^f`-H)O0Rcb(|9}7?XeA#&00ICAAOMjKAvDuX z9;S?d$+Qwe2{xlljDr&=vz@QDGbWH2RS6-yP+37}CKwDP4l;95&Z;aIH34U(MF7JG zmT|2K!m*xBqd@eS#EDCsPRxpQzPAzxN6_v$p}=Yz0~`eUo1p%|05b$YTwTc&;X*>1 Gllx#+$~xZw literal 153 zcmV;K0A~L}T4*^jL0KkKS#$WZ{{R4{dxXJ|0Rlh)|9}7?XeA#&00ICAAOMjKA{ar5 zrhv(s2^14TWNDLX3`U-gcj-1(A#{6#&B4O0B&tn8}i#IT*BAb@a55MIQsP0;k~EHwIW7>A8y77!GhE0^;sSrwS4d He->Zhf}}bj diff --git a/tests/data/t.tbz2.foo b/tests/data/t.tbz2.foo index f4a0f05b1fc939c3433783a804c7af3932e58439..458c8fefa2fdb8f72a264ca826792b1ef28e5cf4 100644 GIT binary patch literal 152 zcmV;J0B8R~T4*^jL0KkKS*E1^*Z=^f`-H)O0Rcb(|9}7?XeA#&00ICAAOMjKAvDuX z9;S?d$+Qwe2{xlljDr&=vz@QDGbWH2RS6-yP+37}CKwDP4l;95&Z;aIH34U(MF7JG zmT|2K!m*xBqd@eS#EDCsPRxpQzPAzxN6_v$p}=Yz0~`eUo1p%|05b$YTwTc&;X*>1 Gllx#+$~xZw literal 153 zcmV;K0A~L}T4*^jL0KkKS#$WZ{{R4{dxXJ|0Rlh)|9}7?XeA#&00ICAAOMjKA{ar5 zrhv(s2^14TWNDLX3`U-gcj-1(A#{6#&B4O0B&tn8}i#IT*BAb@a55MIQsP0;k~EHwIW7>A8y77!GhE0^;sSrwS4d He->Zhf}}bj diff --git a/tests/data/t.tgz b/tests/data/t.tgz index e39819f466d34b7a9f9f185a4fa62c9cbc64e473..63a07011c041366094e705da6333796c0563a988 100644 GIT binary patch literal 149 zcmb2|=3qE6b)P>2^V^G#Tug>Mtq*0EsuxV!a(P~QfocbL@1u`%8A}ycD2NFD&!6nd zRQVxk!n=}dZn4X3&qy1d-Z}NnJJ%~)swSI!>sKqXIkLsy^V;QaTW;F!uipMY(C~=X yxr<+q2Nme9|Mk84|Fqh7_gC#!c{}UXtMkA0|Gi~lKn8ZDjI(~^HZf>0FaQA88b$^H literal 151 zcmb2|=3tm%Qs>RU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.tgz.foo b/tests/data/t.tgz.foo index e39819f466d34b7a9f9f185a4fa62c9cbc64e473..63a07011c041366094e705da6333796c0563a988 100644 GIT binary patch literal 149 zcmb2|=3qE6b)P>2^V^G#Tug>Mtq*0EsuxV!a(P~QfocbL@1u`%8A}ycD2NFD&!6nd zRQVxk!n=}dZn4X3&qy1d-Z}NnJJ%~)swSI!>sKqXIkLsy^V;QaTW;F!uipMY(C~=X yxr<+q2Nme9|Mk84|Fqh7_gC#!c{}UXtMkA0|Gi~lKn8ZDjI(~^HZf>0FaQA88b$^H literal 151 zcmb2|=3tm%Qs>RU{PvwQF&QHL`P{FZ0vsh={_OV^ z<9u?k+i%wC%?r<;zS3T)yy~5Ep|SQP({O2(uWuK3%J3V$3!Zd#hpq4K=jHFe*=y~J zIBq%XUj)~>r=kDr-pAj4_HXMf?^C|Pv41Q79}Tx0#7SgMk46@NPsL diff --git a/tests/data/t.txt.Z b/tests/data/t.txt.Z new file mode 100644 index 0000000000000000000000000000000000000000..b0a98910ee1222157912c5085fc8623f0940cb26 GIT binary patch literal 6 Ncmb22JHaG{0RRVe0p$Py literal 0 HcmV?d00001 diff --git a/tests/data/t.txt.Z.foo b/tests/data/t.txt.Z.foo new file mode 100644 index 0000000000000000000000000000000000000000..b0a98910ee1222157912c5085fc8623f0940cb26 GIT binary patch literal 6 Ncmb22JHaG{0RRVe0p$Py literal 0 HcmV?d00001 diff --git a/tests/data/t.txt.bz2 b/tests/data/t.txt.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..312ccc15535e586924d3dac9ccb6155c3840e545 GIT binary patch literal 37 scmZ>Y%CIzaj8qGb4A*mfz`(%J!63q*z@W&`w6RY%CIzaj8qGb4A*mfz`(%J!63q*z@W&`w6Rq^21Q0O1_p)_{ill=85m8Bfb1tl`OEuaJ0~(QN-^EhTUsZ- O?Q<<7P@I7!G711FUlE`H literal 0 HcmV?d00001 diff --git a/tests/data/t.zip b/tests/data/t.zip index 8b9719c87d213d6b0f75b6a82d1d3f7182eca5db..63343773c67251e50c4226df3efac7a72a074e8f 100644 GIT binary patch literal 194 zcmWIWW@Zs#W&i>kw_qC(4FgO-Mu~m^P@W4cFAJ3K*q~wr5(i;+uzZPLNkxf?QGhoi zlRYzTgMey*K%n7;BZvkW3sR5UV2~;X28D(NjS4`zL?3KTfHx}}kO#D#i6Iq8yMs6k E07JhPZvX%Q literal 299 zcmWIWW@h1H0D;YR!8Tw9lwe|zVJOiL4dG;9E;Oz4E(7Ay3T_5QmKV$n3}7Mvu2&YQ z*HE+VB2b0_gxSG*OY}-AO27t0nbdigV;W#$#1-Jp$Rx*%%LNipw+Jx2a0D?y?qP+v t2g5B0b1+>4F^3Uo!h%MSCrk99ZUY(yavO$WtZX3bn1FC9kZu5R7yvtkEt&uT diff --git a/tests/data/t.zip.foo b/tests/data/t.zip.foo index 8b9719c87d213d6b0f75b6a82d1d3f7182eca5db..63343773c67251e50c4226df3efac7a72a074e8f 100644 GIT binary patch literal 194 zcmWIWW@Zs#W&i>kw_qC(4FgO-Mu~m^P@W4cFAJ3K*q~wr5(i;+uzZPLNkxf?QGhoi zlRYzTgMey*K%n7;BZvkW3sR5UV2~;X28D(NjS4`zL?3KTfHx}}kO#D#i6Iq8yMs6k E07JhPZvX%Q literal 299 zcmWIWW@h1H0D;YR!8Tw9lwe|zVJOiL4dG;9E;Oz4E(7Ay3T_5QmKV$n3}7Mvu2&YQ z*HE+VB2b0_gxSG*OY}-AO27t0nbdigV;W#$#1-Jp$Rx*%%LNipw+Jx2a0D?y?qP+v t2g5B0b1+>4F^3Uo!h%MSCrk99ZUY(yavO$WtZX3bn1FC9kZu5R7yvtkEt&uT diff --git a/tests/test_archives.py b/tests/test_archives.py index 4dd3c98..5aa72af 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from tests import ArchiveTest, needs_os, needs_program, needs_codec +from . import ArchiveTest, needs_os, needs_program, needs_codec, ContentSet class TestArchives (ArchiveTest): @@ -158,36 +158,36 @@ class TestArchives (ArchiveTest): @needs_program('bzip2') def test_bzip2 (self): self.program = 'bzip2' - self.archive_extract('t .bz2') - self.archive_test('t .bz2') - self.archive_create('t .bz2', singlefile=True) + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) + self.archive_test('t.txt.bz2') + self.archive_create('t.txt.bz2', singlefile=True) @needs_program('bzip2') def test_py_bz2 (self): self.program = 'py_bz2' - self.archive_extract('t .bz2') + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) # bzip2 is used to test the created archive - self.archive_create('t .bz2', singlefile=True) + self.archive_create('t.txt.bz2', singlefile=True) @needs_program('pbzip2') def test_pbzip2 (self): self.program = 'pbzip2' - self.archive_extract('t .bz2') - self.archive_test('t .bz2') - self.archive_create('t .bz2', singlefile=True) + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) + self.archive_test('t.txt.bz2') + self.archive_create('t.txt.bz2', singlefile=True) @needs_program('lbzip2') def test_lbzip2 (self): self.program = 'lbzip2' - self.archive_extract('t .bz2') - self.archive_test('t .bz2') - self.archive_create('t .bz2', singlefile=True) + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) + self.archive_test('t.txt.bz2') + self.archive_create('t.txt.bz2', singlefile=True) def test_py_echo (self): self.program = 'py_echo' - self.archive_list('t .bz2') - self.archive_list('t.Z') - self.archive_list('t.lzma') + self.archive_list('t.txt.bz2') + self.archive_list('t.txt.Z') + self.archive_list('t.txt.lzma') self.archive_list('t.txt.lz') self.archive_list('t.txt.lrz') self.archive_list('t.txt.rz') @@ -201,7 +201,7 @@ class TestArchives (ArchiveTest): self.archive_extract('t.zip') self.archive_list('t.zip') self.archive_test('t.zip') - self.archive_extract('t.jar') + self.archive_extract('t.jar', contents=None) self.archive_list('t.jar') self.archive_test('t.jar') @@ -217,61 +217,58 @@ class TestArchives (ArchiveTest): @needs_program('gzip') def test_gzip (self): self.program = 'gzip' - self.archive_commands('t.gz', singlefile=True) self.archive_commands('t.txt.gz', singlefile=True) - self.archive_extract('t.Z') + self.archive_extract('t.txt.Z', contents=ContentSet.Singlefile) @needs_program('gzip') def test_py_gzip (self): self.program = 'py_gzip' - self.archive_extract('t.gz') - self.archive_extract('t.txt.gz') + self.archive_extract('t.txt.gz', contents=ContentSet.Singlefile) # gzip is used to test the created archive - self.archive_create('t.gz', singlefile=True) + self.archive_create('t.txt.gz', singlefile=True) @needs_program('pigz') def test_pigz (self): self.program = 'pigz' - self.archive_commands('t.gz', singlefile=True) self.archive_commands('t.txt.gz', singlefile=True) @needs_program('uncompress.real') def test_uncompress (self): self.program = 'uncompress.real' - self.archive_extract('t.Z') + self.archive_extract('t.txt.Z', contents=ContentSet.Singlefile) @needs_program('compress') def test_compress (self): self.program = 'compress' - self.archive_create('t.Z', singlefile=True) + self.archive_create('t.txt.Z', singlefile=True) @needs_program('7z') def test_p7zip (self): self.program = '7z' self.archive_commands('t .7z') self.archive_commands('t.zip') - self.archive_list('t.gz') - self.archive_list('t .bz2') + self.archive_list('t.txt.gz') + self.archive_list('t.txt.bz2') self.archive_list('t.jar') - self.archive_list('t.Z') + self.archive_list('t.txt.Z') self.archive_list('t.cab') self.archive_list('t.arj') self.archive_list('t.cpio') self.archive_list('t.rpm') self.archive_list('t.deb') - self.archive_extract('t.gz') - self.archive_extract('t .bz2') - self.archive_extract('t.jar') - self.archive_extract('t.Z') + self.archive_extract('t.txt.gz', contents=ContentSet.Singlefile) + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) + self.archive_extract('t.jar', contents=None) + self.archive_extract('t.txt.Z', contents=ContentSet.Singlefile) self.archive_extract('t.cab') self.archive_extract('t.arj') self.archive_extract('t.cpio') - self.archive_extract('t.rpm') - self.archive_extract('t.deb') - self.archive_test('t.gz') - self.archive_test('t .bz2') + self.archive_extract('t.rpm', contents=None) + self.archive_extract('t.deb', contents=None) + self.archive_test('t.txt.gz') + self.archive_test('t.txt.bz2') self.archive_test('t.jar') - self.archive_test('t.Z') + self.archive_test('t.txt.Z') self.archive_test('t.cab') self.archive_test('t.arj') self.archive_test('t.cpio') @@ -292,28 +289,28 @@ class TestArchives (ArchiveTest): self.program = '7za' self.archive_commands('t .7z') self.archive_commands('t.zip') - self.archive_list('t.gz') - self.archive_list('t .bz2') + self.archive_list('t.txt.gz') + self.archive_list('t.txt.bz2') self.archive_list('t.jar') - self.archive_list('t.Z') + self.archive_list('t.txt.Z') self.archive_list('t.cab') #self.archive_list('t.arj') #self.archive_list('t.cpio') self.archive_list('t.rpm') #self.archive_list('t.deb') - self.archive_extract('t.gz') - self.archive_extract('t .bz2') - self.archive_extract('t.jar') - self.archive_extract('t.Z') + self.archive_extract('t.txt.gz', contents=ContentSet.Singlefile) + self.archive_extract('t.txt.bz2', contents=ContentSet.Singlefile) + self.archive_extract('t.jar', contents=None) + self.archive_extract('t.txt.Z', contents=ContentSet.Singlefile) self.archive_extract('t.cab') #self.archive_extract('t.arj') #self.archive_extract('t.cpio') - #self.archive_extract('t.rpm') - #self.archive_extract('t.deb') - self.archive_test('t.gz') - self.archive_test('t .bz2') + #self.archive_extract('t.rpm', contents=None) + #self.archive_extract('t.deb', contents=None) + self.archive_test('t.txt.gz') + self.archive_test('t.txt.bz2') self.archive_test('t.jar') - self.archive_test('t.Z') + self.archive_test('t.txt.Z') self.archive_test('t.cab') #self.archive_test('t.arj') #self.archive_test('t.cpio') @@ -383,13 +380,13 @@ class TestArchives (ArchiveTest): @needs_program('cpio') def test_rpm_extract (self): self.program = 'rpm2cpio' - self.archive_extract('t.rpm') + self.archive_extract('t.rpm', contents=None) @needs_program('dpkg-deb') def test_dpkg (self): self.program = 'dpkg' self.archive_list('t.deb') - self.archive_extract('t.deb') + self.archive_extract('t.deb', contents=None) self.archive_test('t.deb') @needs_program('lzop') @@ -400,36 +397,36 @@ class TestArchives (ArchiveTest): @needs_program('lzma') def test_lzma (self): self.program = 'lzma' - self.archive_test('t.lzma') - self.archive_extract('t.lzma') - self.archive_create('t.lzma', singlefile=True) + self.archive_test('t.txt.lzma') + self.archive_extract('t.txt.lzma', contents=ContentSet.Singlefile) + self.archive_create('t.txt.lzma', singlefile=True) @needs_program('lzip') def test_lzip (self): self.program = 'lzip' self.archive_test('t.txt.lz') - self.archive_extract('t.txt.lz') + self.archive_extract('t.txt.lz', contents=ContentSet.Singlefile) self.archive_create('t.txt.lz', singlefile=True) @needs_program('clzip') def test_clzip (self): self.program = 'clzip' self.archive_test('t.txt.lz') - self.archive_extract('t.txt.lz') + self.archive_extract('t.txt.lz', contents=ContentSet.Singlefile) self.archive_create('t.txt.lz', singlefile=True) @needs_program('plzip') def test_plzip (self): self.program = 'plzip' self.archive_test('t.txt.lz') - self.archive_extract('t.txt.lz') + self.archive_extract('t.txt.lz', contents=ContentSet.Singlefile) self.archive_create('t.txt.lz', singlefile=True) @needs_program('pdlzip') def test_pdlzip (self): self.program = 'pdlzip' self.archive_test('t.txt.lz') - self.archive_extract('t.txt.lz') + self.archive_extract('t.txt.lz', contents=ContentSet.Singlefile) self.archive_create('t.txt.lz', singlefile=True) @needs_program('unalz') @@ -442,7 +439,7 @@ class TestArchives (ArchiveTest): @needs_program('xz') def test_xz (self): self.program = 'xz' - self.archive_commands('t .xz', singlefile=True) + self.archive_commands('t.txt.xz', singlefile=True) @needs_program('lha') def test_lha (self): @@ -495,19 +492,19 @@ class TestArchives (ArchiveTest): @needs_program('mac') def test_mac (self): self.program = 'mac' - self.archive_extract('t.ape') + self.archive_extract('t.ape', contents=None) self.archive_test('t.ape') self.archive_create('t.ape', srcfile="t.wav") @needs_program('shorten') def test_shorten (self): self.program = 'shorten' - self.archive_extract('t.shn') + self.archive_extract('t.shn', contents=None) self.archive_create('t.shn', srcfile="t.wav") @needs_program('flac') def test_flac (self): self.program = 'flac' - self.archive_extract('t.flac') + self.archive_extract('t.flac', contents=None) self.archive_test('t.flac') self.archive_create('t.flac', srcfile="t.wav") diff --git a/tests/test_foo_archives.py b/tests/test_foo_archives.py index 2945553..963ad0c 100644 --- a/tests/test_foo_archives.py +++ b/tests/test_foo_archives.py @@ -212,7 +212,7 @@ class TestArchives (ArchiveTest): def test_py_echo (self): self.program = 'py_echo' self.archive_list('t.bz2.foo') - self.archive_list('t.Z.foo') + self.archive_list('t.txt.Z.foo') # file(1) does not recognize .lzma files #self.archive_list('t.lzma.foo') self.archive_list('t.txt.lz.foo') @@ -230,7 +230,7 @@ class TestArchives (ArchiveTest): self.archive_extract('t.zip.foo') self.archive_list('t.zip.foo') self.archive_test('t.zip.foo') - self.archive_extract('t.jar.foo') + self.archive_extract('t.jar.foo', contents=None) self.archive_list('t.jar.foo') self.archive_test('t.jar.foo') @@ -249,31 +249,28 @@ class TestArchives (ArchiveTest): @needs_program('gzip') def test_gzip (self): self.program = 'gzip' - self.archive_commands('t.gz.foo', format="gzip", singlefile=True) self.archive_commands('t.txt.gz.foo', format="gzip", singlefile=True) - self.archive_extract('t.Z.foo') + self.archive_extract('t.txt.Z.foo') @needs_program('file') @needs_program('gzip') def test_py_gzip (self): self.program = 'py_gzip' - self.archive_extract('t.gz.foo') self.archive_extract('t.txt.gz.foo') # gzip is used to test the created archive - self.archive_create('t.gz.foo', format="gzip", singlefile=True) self.archive_create('t.txt.gz.foo', format="gzip", singlefile=True) @needs_program('file') @needs_program('uncompress.real') def test_uncompress (self): self.program = 'uncompress.real' - self.archive_extract('t.Z.foo') + self.archive_extract('t.txt.Z.foo') @needs_program('file') @needs_program('compress') def test_compress (self): self.program = 'compress' - self.archive_create('t.Z.foo', format="compress", singlefile=True) + self.archive_create('t.txt.Z.foo', format="compress", singlefile=True) @needs_program('file') @needs_program('7z') @@ -281,28 +278,28 @@ class TestArchives (ArchiveTest): self.program = '7z' self.archive_commands('t.7z.foo', format="7z") self.archive_commands('t.zip.foo', format="zip") - self.archive_list('t.gz.foo') - self.archive_list('t.bz2.foo') + self.archive_list('t.txt.gz.foo') + self.archive_list('t.txt.bz2.foo') self.archive_list('t.jar.foo') - self.archive_list('t.Z.foo') + self.archive_list('t.txt.Z.foo') self.archive_list('t.cab.foo') self.archive_list('t.arj.foo') self.archive_list('t.cpio.foo') self.archive_list('t.rpm.foo') self.archive_list('t.deb.foo') - self.archive_extract('t.gz.foo') - self.archive_extract('t.bz2.foo') - self.archive_extract('t.jar.foo') - self.archive_extract('t.Z.foo') + self.archive_extract('t.txt.gz.foo') + self.archive_extract('t.txt.bz2.foo') + self.archive_extract('t.jar.foo', contents=None) + self.archive_extract('t.txt.Z.foo') self.archive_extract('t.cab.foo') self.archive_extract('t.arj.foo') self.archive_extract('t.cpio.foo') - self.archive_extract('t.rpm.foo') - self.archive_extract('t.deb.foo') - self.archive_test('t.gz.foo') - self.archive_test('t.bz2.foo') + self.archive_extract('t.rpm.foo', contents=None) + self.archive_extract('t.deb.foo', contents=None) + self.archive_test('t.txt.gz.foo') + self.archive_test('t.txt.bz2.foo') self.archive_test('t.jar.foo') - self.archive_test('t.Z.foo') + self.archive_test('t.txt.Z.foo') self.archive_test('t.cab.foo') self.archive_test('t.arj.foo') self.archive_test('t.cpio.foo') @@ -315,28 +312,28 @@ class TestArchives (ArchiveTest): self.program = '7za' self.archive_commands('t.7z.foo', format="7z") self.archive_commands('t.zip.foo', format="zip") - self.archive_list('t.gz.foo') - self.archive_list('t.bz2.foo') + self.archive_list('t.txt.gz.foo') + self.archive_list('t.txt.bz2.foo') self.archive_list('t.jar.foo') - self.archive_list('t.Z.foo') + self.archive_list('t.txt.Z.foo') self.archive_list('t.cab.foo') #self.archive_list('t.arj.foo') #self.archive_list('t.cpio.foo') self.archive_list('t.rpm.foo') #self.archive_list('t.deb.foo') - self.archive_extract('t.gz.foo') - self.archive_extract('t.bz2.foo') - self.archive_extract('t.jar.foo') - self.archive_extract('t.Z.foo') + self.archive_extract('t.txt.gz.foo') + self.archive_extract('t.txt.bz2.foo') + self.archive_extract('t.jar.foo', contents=None) + self.archive_extract('t.txt.Z.foo') self.archive_extract('t.cab.foo') #self.archive_extract('t.arj.foo') #self.archive_extract('t.cpio.foo') - #self.archive_extract('t.rpm.foo') - #self.archive_extract('t.deb.foo') - self.archive_test('t.gz.foo') - self.archive_test('t.bz2.foo') + #self.archive_extract('t.rpm.foo', contents=None) + #self.archive_extract('t.deb.foo', contents=None) + self.archive_test('t.txt.gz.foo') + self.archive_test('t.txt.bz2.foo') self.archive_test('t.jar.foo') - self.archive_test('t.Z.foo') + self.archive_test('t.txt.Z.foo') self.archive_test('t.cab.foo') #self.archive_test('t.arj.foo') #self.archive_test('t.cpio.foo') @@ -426,14 +423,14 @@ class TestArchives (ArchiveTest): @needs_program('cpio') def test_rpm_extract (self): self.program = 'rpm2cpio' - self.archive_extract('t.rpm.foo') + self.archive_extract('t.rpm.foo', contents=None) @needs_program('file') @needs_program('dpkg-deb') def test_dpkg (self): self.program = 'dpkg' self.archive_list('t.deb.foo') - self.archive_extract('t.deb.foo') + self.archive_extract('t.deb.foo', contents=None) self.archive_test('t.deb.foo') @needs_program('file')