Remove dangling references in MS Office's [Content_types].xml
This commit is contained in:
parent
212d9c472c
commit
e342671ead
3 changed files with 42 additions and 0 deletions
BIN
tests/data/malformed_content_types.docx
Normal file
BIN
tests/data/malformed_content_types.docx
Normal file
Binary file not shown.
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue