From e342671eadd3f5ff922fe62cae81792d4cd65e83 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 30 Sep 2018 19:52:35 +0200 Subject: Remove dangling references in MS Office's [Content_types].xml --- tests/data/malformed_content_types.docx | Bin 0 -> 4131 bytes tests/test_corrupted_files.py | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 tests/data/malformed_content_types.docx (limited to 'tests') diff --git a/tests/data/malformed_content_types.docx b/tests/data/malformed_content_types.docx new file mode 100644 index 0000000..43ac743 Binary files /dev/null and b/tests/data/malformed_content_types.docx differ diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py index 30039e6..5af0e81 100644 --- a/tests/test_corrupted_files.py +++ b/tests/test_corrupted_files.py @@ -80,6 +80,14 @@ class TestExplicitelyUnsupportedFiles(unittest.TestCase): os.remove('./tests/data/clean.py') +class TestCorruptedContentTypesOffice(unittest.TestCase): + def test_office(self): + shutil.copy('./tests/data/malformed_content_types.docx', './tests/data/clean.docx') + p = office.MSOfficeParser('./tests/data/clean.docx') + self.assertIsNotNone(p) + self.assertFalse(p.remove_all()) + os.remove('./tests/data/clean.docx') + class TestCorruptedFiles(unittest.TestCase): def test_pdf(self): shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') -- cgit v1.3