From 06166e7b1dbbc203666d62dd6c724d9f90bf9101 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sat, 9 Jan 2016 20:58:15 +0100 Subject: [PATCH] Support comic book archives --- doc/README.txt | 24 ++++++++++++------------ doc/changelog.txt | 2 ++ doc/patool.1 | 12 +++++++----- doc/patool.txt | 19 ++++++++++--------- patoolib/util.py | 5 +++++ tests/archives/test_7z.py | 4 ++++ tests/archives/test_7za.py | 4 ++++ tests/archives/test_7zr.py | 2 ++ tests/archives/test_bsdtar.py | 2 ++ tests/archives/test_pytarfile.py | 3 ++- tests/archives/test_pyzipfile.py | 2 ++ tests/archives/test_rar.py | 2 ++ tests/archives/test_star.py | 3 ++- tests/archives/test_tar.py | 3 ++- tests/archives/test_unace.py | 7 ++++++- tests/archives/test_unzip.py | 8 ++++++++ tests/archives/test_zip.py | 12 ++++++++++++ tests/data/t .cb7 | Bin 0 -> 157 bytes tests/data/t.cb7.foo | Bin 0 -> 157 bytes tests/data/t.cba | Bin 0 -> 133 bytes tests/data/t.cba.foo | Bin 0 -> 133 bytes tests/data/t.cbr | Bin 0 -> 110 bytes tests/data/t.cbr.foo | Bin 0 -> 110 bytes tests/data/t.cbt | Bin 0 -> 10240 bytes tests/data/t.cbt.foo | Bin 0 -> 10240 bytes tests/data/t.cbz | Bin 0 -> 194 bytes tests/data/t.cbz.foo | Bin 0 -> 194 bytes tests/test_mime.py | 16 +++++++++++++++- 28 files changed, 99 insertions(+), 31 deletions(-) create mode 100644 tests/data/t .cb7 create mode 100644 tests/data/t.cb7.foo create mode 100644 tests/data/t.cba create mode 100644 tests/data/t.cba.foo create mode 100644 tests/data/t.cbr create mode 100644 tests/data/t.cbr.foo create mode 100644 tests/data/t.cbt create mode 100644 tests/data/t.cbt.foo create mode 100644 tests/data/t.cbz create mode 100644 tests/data/t.cbz.foo diff --git a/doc/README.txt b/doc/README.txt index 2bf717b..0a0ce09 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -3,26 +3,26 @@ Patool Patool is an archive file manager. -Various archive formats can be created, extracted, tested, listed, -searched, repacked and compared with patool. The advantage of patool is its simplicity in -handling archive files without having to remember a myriad of -programs and options. +Various archive formats can be created, extracted, tested, listed, +searched, repacked and compared with patool. The advantage of patool is +its simplicity in handling archive files without having to remember a +myriad of programs and options. The archive format is determined by the file(1) program and as a fallback by the archive file extension. -patool supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), +patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), -LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), -RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and -ZOO (.zoo) formats. It relies on helper applications to handle -those archive formats (for example bzip2 for BZIP2 archives). +LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr), +RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz), +ZIP (.zip, .jar, .cbz) and ZOO (.zoo) archive formats. +It relies on helper applications to handle those archive formats +(for example bzip2 for BZIP2 archives). -The archive formats TAR, ZIP, BZIP2 and GZIP -are supported natively and do not require helper -applications to be installed. +The archive formats TAR, ZIP, BZIP2 and GZIP are supported natively +and do not require helper applications to be installed. Examples --------- diff --git a/doc/changelog.txt b/doc/changelog.txt index 1312e10..586f2df 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,6 +1,8 @@ 1.11 (released xx.xx.216) * Fix 7z unpacking when only p7zip with /usr/bin/7zr is installed. +* Support comic book archives: .cb7 for 7z, .cba for ACE, .cbr for RAR, + .cbt for TAR and .cbz for ZIP archives. 1.10 (released 10.12.2015) diff --git a/doc/patool.1 b/doc/patool.1 index 0b3f32a..4411050 100644 --- a/doc/patool.1 +++ b/doc/patool.1 @@ -25,12 +25,14 @@ files without having to remember a myriad of programs and options. The archive format is determined by the file(1) program and as a fallback by the archive file extension. .PP -\fBpatool\fP supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), -APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), +\fBpatool\fP supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), +ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), -FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz), -LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), RZIP (.rz), SHN (.shn), -TAR (.tar), XZ (.xz), ZIP (.zip, .jar), ZOO (.zoo) and ZPAQ (.zpaq) formats. +FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), +LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr), +RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz), ZIP (.zip, .jar, .cbz), +ZOO (.zoo) and ZPAQ (.zpaq) archive formats. +.br It relies on helper applications to handle those archive formats (for example bzip2 for BZIP2 archives). .PP diff --git a/doc/patool.txt b/doc/patool.txt index c1ebcd2..e5f56ab 100644 --- a/doc/patool.txt +++ b/doc/patool.txt @@ -20,15 +20,16 @@ DESCRIPTION The archive format is determined by the file(1) program and as a fallback by the archive file extension. - patool supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), - APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB - (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), - FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, - .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR - (.rar), RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP - (.zip, .jar), ZOO (.zoo) and ZPAQ (.zpaq) formats. It relies - on helper applications to handle those archive formats (for - example bzip2 for BZIP2 archives). + patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), + ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), + BZIP2 (.bz2), CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB + (.deb), DMS (.dms), FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP + (.lrz), LZH (.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP + (.lzo), RPM (.rpm), RAR (.rar, .cbr), RZIP (.rz), SHN (.shn), + TAR (.tar, .cbt), XZ (.xz), ZIP (.zip, .jar, .cbz), ZOO (.zoo) + and ZPAQ (.zpaq) archive formats. + It relies on helper applications to handle those archive for‐ + mats (for example bzip2 for BZIP2 archives). The archive formats TAR, ZIP, BZIP2 and GZIP are supported natively and do not require helper applications to be diff --git a/patoolib/util.py b/patoolib/util.py index 8a52bb1..d9d033f 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -109,11 +109,14 @@ def add_mimedb_data(mimedb): add_mimetype(mimedb, 'application/x-xz', '.xz') add_mimetype(mimedb, 'application/java-archive', '.jar') add_mimetype(mimedb, 'application/x-rar', '.rar') + add_mimetype(mimedb, 'application/x-rar', '.cbr') add_mimetype(mimedb, 'application/x-7z-compressed', '.7z') + add_mimetype(mimedb, 'application/x-7z-compressed', '.cb7') add_mimetype(mimedb, 'application/x-cab', '.cab') add_mimetype(mimedb, 'application/x-rpm', '.rpm') add_mimetype(mimedb, 'application/x-debian-package', '.deb') add_mimetype(mimedb, 'application/x-ace', '.ace') + add_mimetype(mimedb, 'application/x-ace', '.cba') add_mimetype(mimedb, 'application/x-archive', '.a') add_mimetype(mimedb, 'application/x-alzip', '.alz') add_mimetype(mimedb, 'application/x-arc', '.arc') @@ -125,12 +128,14 @@ def add_mimedb_data(mimedb): add_mimetype(mimedb, 'application/x-dms', '.dms') add_mimetype(mimedb, 'application/x-zip-compressed', '.crx') add_mimetype(mimedb, 'application/x-shar', '.shar') + add_mimetype(mimedb, 'application/x-tar', '.cbt') add_mimetype(mimedb, 'application/x-vhd', '.vhd') add_mimetype(mimedb, 'audio/x-ape', '.ape') add_mimetype(mimedb, 'audio/x-shn', '.shn') add_mimetype(mimedb, 'audio/flac', '.flac') add_mimetype(mimedb, 'application/x-chm', '.chm') add_mimetype(mimedb, 'application/x-iso9660-image', '.iso') + add_mimetype(mimedb, 'application/zip', '.cbz') add_mimetype(mimedb, 'application/zip', '.epub') add_mimetype(mimedb, 'application/zip', '.apk') add_mimetype(mimedb, 'application/zpaq', '.zpaq') diff --git a/tests/archives/test_7z.py b/tests/archives/test_7z.py index 46fd496..a21a19a 100644 --- a/tests/archives/test_7z.py +++ b/tests/archives/test_7z.py @@ -23,7 +23,9 @@ class Test7z (ArchiveTest): @needs_program(program) def test_7z (self): self.archive_commands('t .7z') + self.archive_commands('t .cb7') self.archive_commands('t.zip') + self.archive_commands('t.cbz') self.archive_commands('t.txt.xz', check=Content.Singlefile) self.archive_list('t.txt.gz') self.archive_list('t.txt.bz2') @@ -75,7 +77,9 @@ class Test7z (ArchiveTest): @needs_program(program) def test_7z_file (self): self.archive_commands('t.7z.foo', skip_create=True) + self.archive_commands('t.cb7.foo', skip_create=True) self.archive_commands('t.zip.foo', skip_create=True) + self.archive_commands('t.cbz.foo', skip_create=True) self.archive_commands('t.txt.xz.foo', skip_create=True, check=Content.Singlefile) self.archive_list('t.txt.gz.foo') self.archive_list('t.txt.bz2.foo') diff --git a/tests/archives/test_7za.py b/tests/archives/test_7za.py index af3a442..1e7565c 100644 --- a/tests/archives/test_7za.py +++ b/tests/archives/test_7za.py @@ -23,7 +23,9 @@ class Test7za (ArchiveTest): @needs_program(program) def test_p7azip (self): self.archive_commands('t .7z') + self.archive_commands('t .cb7') self.archive_commands('t.zip') + self.archive_commands('t.cbz') self.archive_list('t.txt.gz') self.archive_list('t.txt.bz2') self.archive_list('t.jar') @@ -47,7 +49,9 @@ class Test7za (ArchiveTest): @needs_program(program) def test_7za_file (self): self.archive_commands('t.7z.foo', skip_create=True) + self.archive_commands('t.cb7.foo', skip_create=True) self.archive_commands('t.zip.foo', skip_create=True) + self.archive_commands('t.cbz.foo', skip_create=True) self.archive_list('t.txt.gz.foo') self.archive_list('t.txt.bz2.foo') self.archive_list('t.jar.foo') diff --git a/tests/archives/test_7zr.py b/tests/archives/test_7zr.py index 671e37e..f76adda 100644 --- a/tests/archives/test_7zr.py +++ b/tests/archives/test_7zr.py @@ -23,8 +23,10 @@ class Test7zr (ArchiveTest): @needs_program(program) def test_7zr (self): self.archive_commands('t .7z') + self.archive_commands('t .cb7') @needs_program('file') @needs_program(program) def test_7z_file (self): self.archive_commands('t.7z.foo', skip_create=True) + self.archive_commands('t.cb7.foo', skip_create=True) diff --git a/tests/archives/test_bsdtar.py b/tests/archives/test_bsdtar.py index 028a658..0b82760 100644 --- a/tests/archives/test_bsdtar.py +++ b/tests/archives/test_bsdtar.py @@ -23,6 +23,7 @@ class TestBsdtar (ArchiveTest): @needs_program(program) def test_bsdtar (self): self.archive_commands('t.tar') + self.archive_commands('t.cbt') @needs_codec(program, 'gzip') def test_bsdtar_gz (self): @@ -58,6 +59,7 @@ class TestBsdtar (ArchiveTest): @needs_program(program) def test_bsdtar_file (self): self.archive_commands('t.tar.foo', skip_create=True) + self.archive_commands('t.cbt.foo', skip_create=True) @needs_program('file') @needs_codec(program, 'gzip') diff --git a/tests/archives/test_pytarfile.py b/tests/archives/test_pytarfile.py index 07f1a2c..d4ea580 100644 --- a/tests/archives/test_pytarfile.py +++ b/tests/archives/test_pytarfile.py @@ -22,6 +22,7 @@ class TestPytarfile (ArchiveTest): def test_py_tarfile (self): self.archive_commands('t.tar') + self.archive_commands('t.cbt') def test_py_tarfile_gz (self): self.archive_commands('t.tar.gz') @@ -34,6 +35,7 @@ class TestPytarfile (ArchiveTest): @needs_program('file') def test_py_tarfile_file (self): self.archive_commands('t.tar.foo', skip_create=True) + self.archive_commands('t.cbt.foo', skip_create=True) @needs_program('file') def test_py_tarfile_gz_file (self): @@ -44,4 +46,3 @@ class TestPytarfile (ArchiveTest): def test_py_tarfile_bz2_file (self): self.archive_commands('t.tar.bz2.foo', skip_create=True) self.archive_commands('t.tbz2.foo', skip_create=True) - diff --git a/tests/archives/test_pyzipfile.py b/tests/archives/test_pyzipfile.py index 8235622..7d2b912 100644 --- a/tests/archives/test_pyzipfile.py +++ b/tests/archives/test_pyzipfile.py @@ -22,8 +22,10 @@ class TestPyzipfile (ArchiveTest): def test_py_zipfile(self): self.archive_commands('t.zip') + self.archive_commands('t.cbz') @needs_program('file') def test_py_zipfile_file(self): self.archive_commands('t.zip.foo', skip_create=True) + self.archive_commands('t.cbz.foo', skip_create=True) diff --git a/tests/archives/test_rar.py b/tests/archives/test_rar.py index c4c02f8..7a1e188 100644 --- a/tests/archives/test_rar.py +++ b/tests/archives/test_rar.py @@ -23,9 +23,11 @@ class TestRar (ArchiveTest): @needs_program(program) def test_rar(self): self.archive_commands('t.rar') + self.archive_commands('t.cbr') @needs_program('file') @needs_program(program) def test_rar_file(self): self.archive_commands('t.rar.foo', skip_create=True) + self.archive_commands('t.cbr.foo', skip_create=True) diff --git a/tests/archives/test_star.py b/tests/archives/test_star.py index ae77c6b..3542fa9 100644 --- a/tests/archives/test_star.py +++ b/tests/archives/test_star.py @@ -23,6 +23,7 @@ class TestStar (ArchiveTest): @needs_program(program) def test_star (self): self.archive_commands('t.tar') + self.archive_commands('t.cbt') @needs_codec(program, 'gzip') def test_star_gz (self): @@ -57,6 +58,7 @@ class TestStar (ArchiveTest): @needs_program(program) def test_star_file (self): self.archive_commands('t.tar.foo', skip_create=True) + self.archive_commands('t.cbt.foo', skip_create=True) @needs_program('file') @needs_codec(program, 'gzip') @@ -91,4 +93,3 @@ class TestStar (ArchiveTest): @needs_codec(program, 'xz') def test_star_xz_file (self): self.archive_commands('t.tar.xz.foo', skip_create=True) - diff --git a/tests/archives/test_tar.py b/tests/archives/test_tar.py index 5746255..5b4527b 100644 --- a/tests/archives/test_tar.py +++ b/tests/archives/test_tar.py @@ -23,6 +23,7 @@ class TestTar (ArchiveTest): @needs_program(program) def test_tar (self): self.archive_commands('t.tar') + self.archive_commands('t.cbt') @needs_codec(program, 'gzip') def test_tar_gz (self): @@ -59,6 +60,7 @@ class TestTar (ArchiveTest): @needs_program(program) def test_tar_file (self): self.archive_commands('t.tar.foo', skip_create=True) + self.archive_commands('t.cbt.foo', skip_create=True) @needs_program('file') @needs_codec(program, 'gzip') @@ -96,4 +98,3 @@ class TestTar (ArchiveTest): @needs_codec(program, 'xz') def test_tar_xz_file (self): self.archive_commands('t.tar.xz.foo', skip_create=True) - diff --git a/tests/archives/test_unace.py b/tests/archives/test_unace.py index e958bd4..e197485 100644 --- a/tests/archives/test_unace.py +++ b/tests/archives/test_unace.py @@ -25,6 +25,9 @@ class TestUnace (ArchiveTest): self.archive_list('t.ace') self.archive_test('t.ace') self.archive_extract('t.ace') + self.archive_list('t.cba') + self.archive_test('t.cba') + self.archive_extract('t.cba') @needs_program('file') @needs_program(program) @@ -32,4 +35,6 @@ class TestUnace (ArchiveTest): self.archive_list('t.ace.foo') self.archive_test('t.ace.foo') self.archive_extract('t.ace.foo') - + self.archive_list('t.cba.foo') + self.archive_test('t.cba.foo') + self.archive_extract('t.cba.foo') diff --git a/tests/archives/test_unzip.py b/tests/archives/test_unzip.py index 87709b7..deba97e 100644 --- a/tests/archives/test_unzip.py +++ b/tests/archives/test_unzip.py @@ -25,12 +25,16 @@ class TestUnzip (ArchiveTest): self.archive_extract('t.zip', check=None) self.archive_list('t.zip') self.archive_test('t.zip') + self.archive_extract('t.cbz', check=None) + self.archive_list('t.cbz') + self.archive_test('t.cbz') self.archive_extract('t.jar', check=None) self.archive_list('t.jar') self.archive_test('t.jar') self.archive_extract('t.epub', check=None) self.archive_list('t.epub') self.archive_test('t.epub') + self.archive_extract('t.apk', check=None) self.archive_list('t.apk') self.archive_test('t.apk') @@ -40,11 +44,15 @@ class TestUnzip (ArchiveTest): self.archive_extract('t.zip.foo', check=None) self.archive_list('t.zip.foo') self.archive_test('t.zip.foo') + self.archive_extract('t.cbz.foo', check=None) + self.archive_list('t.cbz.foo') + self.archive_test('t.cbz.foo') self.archive_extract('t.jar.foo', check=None) self.archive_list('t.jar.foo') self.archive_test('t.jar.foo') self.archive_extract('t.epub.foo', check=None) self.archive_list('t.epub.foo') self.archive_test('t.epub.foo') + self.archive_extract('t.apk.foo', check=None) self.archive_list('t.apk.foo') self.archive_test('t.apk.foo') diff --git a/tests/archives/test_zip.py b/tests/archives/test_zip.py index 6e0e7a5..3fade9b 100644 --- a/tests/archives/test_zip.py +++ b/tests/archives/test_zip.py @@ -24,8 +24,20 @@ class TestZip (ArchiveTest): def test_zip (self): self.archive_create('t.zip') self.archive_test('t.zip') + self.archive_create('t.cbz') + self.archive_test('t.cbz') + self.archive_create('t.apk') + self.archive_test('t.apk') + self.archive_create('t.jar') + self.archive_test('t.jar') + self.archive_create('t.epub') + self.archive_test('t.epub') @needs_program('file') @needs_program(program) def test_zip_file (self): self.archive_test('t.zip.foo') + self.archive_test('t.cbz.foo') + self.archive_test('t.apk.foo') + self.archive_test('t.jar.foo') + self.archive_test('t.epub.foo') diff --git a/tests/data/t .cb7 b/tests/data/t .cb7 new file mode 100644 index 0000000000000000000000000000000000000000..7149c7fb954a92df91fd08c1db396f560800dea5 GIT binary patch literal 157 zcmXr7+Ou9=hJpFqw(l2W86ZFbO0UgW!p$JXQv>EU8ndtCKc`w3=ya;stNoC|sdHyO zs0#8Qe`~?u%*ys{_xIO1y&pd3u9&j=(kelF=J$=q|0VeKEaOq_Wt`rT-f*C-C3i)9 zPu33Wjkj*OJ*n!s4K!7pjh&G*jDek-k%3W}nURq-mO+4lfhUoR(JgO{JOcv&+9)*a literal 0 HcmV?d00001 diff --git a/tests/data/t.cb7.foo b/tests/data/t.cb7.foo new file mode 100644 index 0000000000000000000000000000000000000000..7149c7fb954a92df91fd08c1db396f560800dea5 GIT binary patch literal 157 zcmXr7+Ou9=hJpFqw(l2W86ZFbO0UgW!p$JXQv>EU8ndtCKc`w3=ya;stNoC|sdHyO zs0#8Qe`~?u%*ys{_xIO1y&pd3u9&j=(kelF=J$=q|0VeKEaOq_Wt`rT-f*C-C3i)9 zPu33Wjkj*OJ*n!s4K!7pjh&G*jDek-k%3W}nURq-mO+4lfhUoR(JgO{JOcv&+9)*a literal 0 HcmV?d00001 diff --git a/tests/data/t.cba b/tests/data/t.cba new file mode 100644 index 0000000000000000000000000000000000000000..80ce57d3be6b477d7213f8aad89dd064df83298a GIT binary patch literal 133 zcmdn(YRJIAFhNVp(b-i?OGJc;K{21jahb&f4WKZCm{zD?kgL0AaENP=tBXRIYf!MK zzn|9ET?!10j35PIFe#VCQ2@yL4+KoiTnr(uj0`2QMruGc4NO3B5WWReqX4AK{coRT S0IOkVD2XZ2E2$_kF#-U$?j6wp literal 0 HcmV?d00001 diff --git a/tests/data/t.cba.foo b/tests/data/t.cba.foo new file mode 100644 index 0000000000000000000000000000000000000000..80ce57d3be6b477d7213f8aad89dd064df83298a GIT binary patch literal 133 zcmdn(YRJIAFhNVp(b-i?OGJc;K{21jahb&f4WKZCm{zD?kgL0AaENP=tBXRIYf!MK zzn|9ET?!10j35PIFe#VCQ2@yL4+KoiTnr(uj0`2QMruGc4NO3B5WWReqX4AK{coRT S0IOkVD2XZ2E2$_kF#-U$?j6wp literal 0 HcmV?d00001 diff --git a/tests/data/t.cbr b/tests/data/t.cbr new file mode 100644 index 0000000000000000000000000000000000000000..82c4a6a0ce927a6ea1c3a5d1b2c8dd031853bce6 GIT binary patch literal 110 zcmWGaEK-zWXE;Bhn1O+p0RnQKmnbx-GjIcWOhC-su|dU1)-Kpa)|j1PK_df0Nlb}e xNkxeu_m?B{-q)MW{}z=jU-FJTwtWO(5S)N#bNn!$mc0RV+)8Pos( literal 0 HcmV?d00001 diff --git a/tests/data/t.cbr.foo b/tests/data/t.cbr.foo new file mode 100644 index 0000000000000000000000000000000000000000..82c4a6a0ce927a6ea1c3a5d1b2c8dd031853bce6 GIT binary patch literal 110 zcmWGaEK-zWXE;Bhn1O+p0RnQKmnbx-GjIcWOhC-su|dU1)-Kpa)|j1PK_df0Nlb}e xNkxeu_m?B{-q)MW{}z=jU-FJTwtWO(5S)N#bNn!$mc0RV+)8Pos( literal 0 HcmV?d00001 diff --git a/tests/data/t.cbt b/tests/data/t.cbt new file mode 100644 index 0000000000000000000000000000000000000000..3adf9da87fcdedc53bb0b0ecef71334a3fa8ecb4 GIT binary patch literal 10240 zcmeIvK?(vf429twr6+Kjw9}qva3u^bG>XT!1#uyat}23mHd%x=;d?&G@QSVK9HljV z>3!5oR8y)snOT;ou~?Nb55KG}xSV}Cg&_N7y&jI+8$ZprU;gyOC*S$ahu+u&F8N*l z_RL?Cwfwc1Nr*$QdVK!p`DgnEGCL4J009ILKmY**5I_I{1Q0*~0R#|0009ILKmY** T5I_I{1Q0*~0R#|0V1&RO6yYW; literal 0 HcmV?d00001 diff --git a/tests/data/t.cbt.foo b/tests/data/t.cbt.foo new file mode 100644 index 0000000000000000000000000000000000000000..3adf9da87fcdedc53bb0b0ecef71334a3fa8ecb4 GIT binary patch literal 10240 zcmeIvK?(vf429twr6+Kjw9}qva3u^bG>XT!1#uyat}23mHd%x=;d?&G@QSVK9HljV z>3!5oR8y)snOT;ou~?Nb55KG}xSV}Cg&_N7y&jI+8$ZprU;gyOC*S$ahu+u&F8N*l z_RL?Cwfwc1Nr*$QdVK!p`DgnEGCL4J009ILKmY**5I_I{1Q0*~0R#|0009ILKmY** T5I_I{1Q0*~0R#|0V1&RO6yYW; literal 0 HcmV?d00001 diff --git a/tests/data/t.cbz b/tests/data/t.cbz new file mode 100644 index 0000000000000000000000000000000000000000..63343773c67251e50c4226df3efac7a72a074e8f 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 0 HcmV?d00001 diff --git a/tests/data/t.cbz.foo b/tests/data/t.cbz.foo new file mode 100644 index 0000000000000000000000000000000000000000..63343773c67251e50c4226df3efac7a72a074e8f 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 0 HcmV?d00001 diff --git a/tests/test_mime.py b/tests/test_mime.py index ce4e6b9..197c130 100644 --- a/tests/test_mime.py +++ b/tests/test_mime.py @@ -46,7 +46,8 @@ class TestMime (unittest.TestCase): @needs_program('file') def test_mime_file (self): self.mime_test_file("t .7z", "application/x-7z-compressed") - self.mime_test_file("t.7z.foo", "application/x-7z-compressed") + self.mime_test_file("t .cb7", "application/x-7z-compressed") + self.mime_test_file("t.cb7.foo", "application/x-7z-compressed") self.mime_test_file("t.arj", "application/x-arj") self.mime_test_file("t.arj.foo", "application/x-arj") self.mime_test_file("t.txt.bz2", "application/x-bzip2") @@ -69,10 +70,14 @@ class TestMime (unittest.TestCase): self.mime_test_file("t.txt.lzo.foo", "application/x-lzop") self.mime_test_file("t.rar", "application/x-rar") self.mime_test_file("t.rar.foo", "application/x-rar") + self.mime_test_file("t.cbr", "application/x-rar") + self.mime_test_file("t.cbr.foo", "application/x-rar") self.mime_test_file("t.rpm", "application/x-rpm") self.mime_test_file("t.rpm.foo", "application/x-rpm") self.mime_test_file("t.tar", "application/x-tar") self.mime_test_file("t.tar.foo", "application/x-tar") + self.mime_test_file("t.cbt", "application/x-tar") + self.mime_test_file("t.cbt.foo", "application/x-tar") self.mime_test_file("t.tar.lz", "application/x-tar", "lzip") self.mime_test_file("t.tar.bz2", "application/x-tar", "bzip2") self.mime_test_file("t.tbz2", "application/x-tar", "bzip2") @@ -92,8 +97,12 @@ class TestMime (unittest.TestCase): self.mime_test_file("t.jar.foo", "application/zip") self.mime_test_file("t.zip", "application/zip") self.mime_test_file("t.zip.foo", "application/zip") + self.mime_test_file("t.cbz", "application/zip") + self.mime_test_file("t.cbz.foo", "application/zip") self.mime_test_file("t.ace", "application/x-ace") self.mime_test_file("t.ace.foo", "application/x-ace") + self.mime_test_file("t.cba", "application/x-ace") + self.mime_test_file("t.cba.foo", "application/x-ace") self.mime_test_file("t.txt.a", "application/x-archive") self.mime_test_file("t.txt.a.foo", "application/x-archive") self.mime_test_file("t.lha", "application/x-lha") @@ -159,9 +168,11 @@ class TestMime (unittest.TestCase): def test_mime_mimedb (self): self.mime_test_mimedb("t .7z", "application/x-7z-compressed") + self.mime_test_mimedb("t .cb7", "application/x-7z-compressed") self.mime_test_mimedb("t.arj", "application/x-arj") self.mime_test_mimedb("t .bz2", "application/x-bzip2") self.mime_test_mimedb("t.cab", "application/x-cab") + self.mime_test_mimedb("t.cbr", ("application/rar", "application/x-rar")) self.mime_test_mimedb("t.cpio", "application/x-cpio") self.mime_test_mimedb("t.deb", "application/x-debian-package") self.mime_test_mimedb("t.gz", "application/gzip") @@ -172,6 +183,7 @@ class TestMime (unittest.TestCase): self.mime_test_mimedb("t.rar", ("application/rar", "application/x-rar")) self.mime_test_mimedb("t.rpm", ("application/x-redhat-package-manager", "application/x-rpm")) self.mime_test_mimedb("t.tar", "application/x-tar") + self.mime_test_mimedb("t.cbt", "application/x-tar") self.mime_test_mimedb("t.tar.bz2", "application/x-tar", "bzip2") self.mime_test_mimedb("t.tar.gz", "application/x-tar", "gzip") self.mime_test_mimedb("t.tar.lzma", "application/x-tar", "lzma") @@ -186,7 +198,9 @@ class TestMime (unittest.TestCase): self.mime_test_mimedb("t .xz", "application/x-xz") self.mime_test_mimedb("t.Z", "application/x-compress") self.mime_test_mimedb("t.zip", ("application/zip", "application/x-zip-compressed")) + self.mime_test_mimedb("t.cbz", ("application/zip", "application/x-zip-compressed")) self.mime_test_mimedb("t.ace", "application/x-ace") + self.mime_test_mimedb("t.cba", "application/x-ace") self.mime_test_mimedb("t.a", "application/x-archive") self.mime_test_mimedb("t.lha", "application/x-lha") self.mime_test_mimedb("t.lzh", "application/x-lzh")