Commit 58a1563a authored by jvoisin's avatar jvoisin
Browse files

Better test of corrupted MSOffice files

parent f6381680
Pipeline #48807 failed with stages
in 27 seconds
...@@ -89,9 +89,8 @@ class TestExplicitelyUnsupportedFiles(unittest.TestCase): ...@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment