1
0
mirror of synced 2024-11-24 18:24:23 +01:00

Better test of corrupted MSOffice files

This commit is contained in:
jvoisin 2020-11-06 16:05:42 +01:00
parent f638168033
commit 58a1563a99
2 changed files with 2 additions and 3 deletions

View File

@ -89,9 +89,8 @@ class TestExplicitelyUnsupportedFiles(unittest.TestCase):
class TestWrongContentTypesFileOffice(unittest.TestCase):
def test_office_incomplete(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())
with self.assertRaises(ValueError):
office.MSOfficeParser('./tests/data/clean.docx')
os.remove('./tests/data/clean.docx')
def test_office_broken(self):