From 8ae050701ffb1181b0614ecd7f26125b2ac0fff1 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 27 Jun 2014 17:59:58 +0200 Subject: [PATCH] Handle *.epub files --- patoolib/util.py | 1 + tests/archives/test_unzip.py | 7 ++++++- tests/data/t.epub | Bin 0 -> 2830 bytes tests/data/t.epub.foo | Bin 0 -> 2830 bytes tests/test_mime.py | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/data/t.epub create mode 100644 tests/data/t.epub.foo diff --git a/patoolib/util.py b/patoolib/util.py index c3dc2e2..5f13345 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -129,6 +129,7 @@ def add_mimedb_data(mimedb): 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', '.epub') def add_mimetype(mimedb, mimetype, extension): diff --git a/tests/archives/test_unzip.py b/tests/archives/test_unzip.py index 22ce0b4..4939809 100644 --- a/tests/archives/test_unzip.py +++ b/tests/archives/test_unzip.py @@ -28,6 +28,9 @@ class TestUnzip (ArchiveTest): 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') @needs_program('file') @needs_program(program) @@ -38,4 +41,6 @@ class TestUnzip (ArchiveTest): 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') diff --git a/tests/data/t.epub b/tests/data/t.epub new file mode 100644 index 0000000000000000000000000000000000000000..79341a73a85aba51f7bdcb4a0d37006981962b6c GIT binary patch literal 2830 zcmZ`)3p|tSAD_9-T{~{6=oF=~DO)im%q40#HMtzOndK5Qwip$eB)6Rr(xHvYJyKM1 zuZ~*?CrU@UoLobWTF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