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):
|
class TestWrongContentTypesFileOffice(unittest.TestCase):
|
||||||
def test_office_incomplete(self):
|
def test_office_incomplete(self):
|
||||||
shutil.copy('./tests/data/malformed_content_types.docx', './tests/data/clean.docx')
|
shutil.copy('./tests/data/malformed_content_types.docx', './tests/data/clean.docx')
|
||||||
p = office.MSOfficeParser('./tests/data/clean.docx')
|
with self.assertRaises(ValueError):
|
||||||
self.assertIsNotNone(p)
|
office.MSOfficeParser('./tests/data/clean.docx')
|
||||||
self.assertFalse(p.remove_all())
|
|
||||||
os.remove('./tests/data/clean.docx')
|
os.remove('./tests/data/clean.docx')
|
||||||
|
|
||||||
def test_office_broken(self):
|
def test_office_broken(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user