diff options
| author | jvoisin | 2019-02-27 23:04:38 +0100 |
|---|---|---|
| committer | jvoisin | 2019-02-27 23:04:38 +0100 |
| commit | 73d2966e8c10eb6c083a2abacc53f3297d16376e (patch) | |
| tree | 24830b2e95097f220379930e8c654ad073c04bc0 /tests/test_libmat2.py | |
| parent | eb2e702f3700a0ac88d10a524a5f6c573a52a8dd (diff) | |
Improve epub support
Diffstat (limited to 'tests/test_libmat2.py')
| -rw-r--r-- | tests/test_libmat2.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 249c56d..f4b1890 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | import unittest | 3 | import unittest |
| 4 | import shutil | 4 | import shutil |
| 5 | import os | 5 | import os |
| 6 | import re | ||
| 6 | import zipfile | 7 | import zipfile |
| 7 | 8 | ||
| 8 | from libmat2 import pdf, images, audio, office, parser_factory, torrent, harmless | 9 | from libmat2 import pdf, images, audio, office, parser_factory, torrent, harmless |
| @@ -644,7 +645,10 @@ class TestCleaning(unittest.TestCase): | |||
| 644 | self.assertTrue(ret) | 645 | self.assertTrue(ret) |
| 645 | 646 | ||
| 646 | p = epub.EPUBParser('./tests/data/clean.cleaned.epub') | 647 | p = epub.EPUBParser('./tests/data/clean.cleaned.epub') |
| 647 | self.assertEqual(p.get_meta(), {}) | 648 | meta = p.get_meta() |
| 649 | res = re.match(meta['OEBPS/content.opf']['metadata'], '^<dc:identifier>[0-9a-f-]+</dc:identifier><dc:title /><dc:language />$') | ||
| 650 | self.assertNotEqual(res, False) | ||
| 651 | |||
| 648 | self.assertTrue(p.remove_all()) | 652 | self.assertTrue(p.remove_all()) |
| 649 | 653 | ||
| 650 | os.remove('./tests/data/clean.epub') | 654 | os.remove('./tests/data/clean.epub') |
