summaryrefslogtreecommitdiff
path: root/tests/test_libmat2.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_libmat2.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
index c64e4cb..32ae543 100644
--- a/tests/test_libmat2.py
+++ b/tests/test_libmat2.py
@@ -858,3 +858,20 @@ class TestComplexOfficeFiles(unittest.TestCase):
858 858
859 os.remove(target) 859 os.remove(target)
860 os.remove(p.output_filename) 860 os.remove(p.output_filename)
861
862class TextDocx(unittest.TestCase):
863 def test_comment_xml_is_removed(self):
864 with zipfile.ZipFile('./tests/data/comment.docx') as zipin:
865 # Check if 'word/comments.xml' exists in the zip
866 self.assertIn('word/comments.xml', zipin.namelist())
867
868 shutil.copy('./tests/data/comment.docx', './tests/data/comment_clean.docx')
869 p = office.MSOfficeParser('./tests/data/comment_clean.docx')
870 self.assertTrue(p.remove_all())
871
872 with zipfile.ZipFile('./tests/data/comment_clean.cleaned.docx') as zipin:
873 # Check if 'word/comments.xml' exists in the zip
874 self.assertNotIn('word/comments.xml', zipin.namelist())
875
876 os.remove('./tests/data/comment_clean.docx')
877 os.remove('./tests/data/comment_clean.cleaned.docx') \ No newline at end of file