1
0
Fork 0
mirror of synced 2025-07-04 20:37:34 +02:00

Remove dangling references in MS Office's [Content_types].xml

This commit is contained in:
jvoisin 2018-09-30 19:52:35 +02:00
parent 212d9c472c
commit e342671ead
3 changed files with 42 additions and 0 deletions

Binary file not shown.

View file

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