Better test of corrupted MSOffice files
This commit is contained in:
parent
f638168033
commit
58a1563a99
Binary file not shown.
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user