Better test of corrupted MSOffice files
This commit is contained in:
parent
f638168033
commit
58a1563a99
2 changed files with 2 additions and 3 deletions
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…
Add table
Add a link
Reference in a new issue