diff options
| author | jvoisin | 2018-09-30 19:52:35 +0200 |
|---|---|---|
| committer | jvoisin | 2018-09-30 19:53:18 +0200 |
| commit | e342671eadd3f5ff922fe62cae81792d4cd65e83 (patch) | |
| tree | cd85ad31860cdb3d4a670bd0f1c3dd48ff5129c6 /tests | |
| parent | 212d9c472cd7017cab31449ff75461bebd7a40d4 (diff) | |
Remove dangling references in MS Office's [Content_types].xml
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/data/malformed_content_types.docx | bin | 0 -> 4131 bytes | |||
| -rw-r--r-- | tests/test_corrupted_files.py | 8 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/data/malformed_content_types.docx b/tests/data/malformed_content_types.docx new file mode 100644 index 0000000..43ac743 --- /dev/null +++ b/tests/data/malformed_content_types.docx | |||
| Binary files 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): | |||
| 80 | os.remove('./tests/data/clean.py') | 80 | os.remove('./tests/data/clean.py') |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | class TestCorruptedContentTypesOffice(unittest.TestCase): | ||
| 84 | def test_office(self): | ||
| 85 | shutil.copy('./tests/data/malformed_content_types.docx', './tests/data/clean.docx') | ||
| 86 | p = office.MSOfficeParser('./tests/data/clean.docx') | ||
| 87 | self.assertIsNotNone(p) | ||
| 88 | self.assertFalse(p.remove_all()) | ||
| 89 | os.remove('./tests/data/clean.docx') | ||
| 90 | |||
| 83 | class TestCorruptedFiles(unittest.TestCase): | 91 | class TestCorruptedFiles(unittest.TestCase): |
| 84 | def test_pdf(self): | 92 | def test_pdf(self): |
| 85 | shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') | 93 | shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') |
