Handle *.epub files

This commit is contained in:
Bastian Kleineidam 2014-06-27 17:59:58 +02:00
parent 47929ecac8
commit 8ae050701f
5 changed files with 9 additions and 1 deletions

View File

@ -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):

View File

@ -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')

BIN
tests/data/t.epub Normal file

Binary file not shown.

BIN
tests/data/t.epub.foo Normal file

Binary file not shown.

View File

@ -124,6 +124,7 @@ class TestMime (unittest.TestCase):
self.mime_test_file("t.chm", "application/x-chm")
self.mime_test_file("t.chm.foo", "application/x-chm")
self.mime_test_file("t.iso", "application/x-iso9660-image")
self.mime_test_file("t.epub", "application/zip")
@needs_program('file')
@needs_program('lzip')
@ -198,3 +199,4 @@ class TestMime (unittest.TestCase):
self.mime_test_mimedb("t.adf", "application/x-adf")
self.mime_test_mimedb("t.chm", "application/x-chm")
self.mime_test_mimedb("t.iso", "application/x-iso9660-image")
self.mime_test_mimedb("t.epub", "application/zip")