From d93beae6ac6fc860a31703503974f1bcb276c4b6 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sat, 12 May 2012 12:44:07 +0200 Subject: [PATCH] Add tests for archives needing file(1) recognition. --- tests/test_foo_archives.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/test_foo_archives.py b/tests/test_foo_archives.py index 25c5330..8d267bf 100644 --- a/tests/test_foo_archives.py +++ b/tests/test_foo_archives.py @@ -112,6 +112,23 @@ class TestArchives (ArchiveTest): self.program = 'star' self.archive_commands('t.tar.xz.foo', format="tar", encoding="xz") + @needs_program('file') + def test_pytarfile_file (self): + self.program = 'pytarfile' + self.archive_commands('t.tar.foo', format="tar") + + @needs_program('file') + def test_pytarfile_gz_file (self): + self.program = 'pytarfile' + self.archive_commands('t.tar.gz.foo', format="tar", encoding="gzip") + self.archive_commands('t.tgz.foo', format="tar", encoding="gzip") + + @needs_program('file') + def test_pytarfile_bz2 (self): + self.program = 'pytarfile' + self.archive_commands('t.tar.bz2.foo', format="tar", encoding="bzip2") + self.archive_commands('t.tbz2.foo', format="tar", encoding="bzip2") + @needs_program('file') @needs_program('bzip2') def test_bzip2 (self): @@ -120,6 +137,12 @@ class TestArchives (ArchiveTest): self.archive_test('t.bz2.foo') self.archive_create('t.bz2.foo', format="bzip2", singlefile=True) + @needs_program('file') + def test_pybz2 (self): + self.program = 'pybz2' + self.archive_extract('t.bz2.foo') + self.archive_create('t.bz2.foo', format="bzip2", singlefile=True) + @needs_program('file') @needs_program('pbzip2') def test_pbzip2 (self): @@ -162,6 +185,11 @@ class TestArchives (ArchiveTest): self.program = 'zip' self.archive_create('t.zip.foo', format="zip") + @needs_program('file') + def test_pyzipfile (self): + self.program = 'pyzipfile' + self.archive_commands('t.zip.foo', format="zip") + @needs_program('file') @needs_program('gzip') def test_gzip (self): @@ -170,6 +198,14 @@ class TestArchives (ArchiveTest): self.archive_commands('t.txt.gz.foo', format="gzip", singlefile=True) self.archive_extract('t.Z.foo') + @needs_program('file') + def test_pygzip (self): + self.program = 'pygzip' + self.archive_extract('t.gz.foo') + self.archive_extract('t.txt.gz.foo') + 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):