aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjvoisin <julien.voisin@dustri.org>2020-11-06 16:05:42 +0100
committerjvoisin <julien.voisin@dustri.org>2020-11-06 16:05:42 +0100
commit58a1563a9935115ac7444d57433aa892887d1b0f (patch)
treeb32a5448b61129847a069aec94764a00389efa1e
parentf638168033583329db1cd2af7b929a0000f10169 (diff)
downloadmat2-58a1563a9935115ac7444d57433aa892887d1b0f.tar.gz
mat2-58a1563a9935115ac7444d57433aa892887d1b0f.tar.bz2
mat2-58a1563a9935115ac7444d57433aa892887d1b0f.zip
Better test of corrupted MSOffice files
-rw-r--r--tests/data/malformed_content_types.docxbin4135 -> 4140 bytes
-rw-r--r--tests/test_corrupted_files.py5
2 files changed, 2 insertions, 3 deletions
diff --git a/tests/data/malformed_content_types.docx b/tests/data/malformed_content_types.docx
index cc5caf3..edc026d 100644
--- a/tests/data/malformed_content_types.docx
+++ b/tests/data/malformed_content_types.docx
Binary files differ
diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py
index d4b40a5..8a8cffe 100644
--- a/tests/test_corrupted_files.py
+++ b/tests/test_corrupted_files.py
@@ -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):