diff options
Diffstat (limited to 'tests/test_libmat2.py')
| -rw-r--r-- | tests/test_libmat2.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 3ea044f..1573790 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -122,6 +122,27 @@ class TestRemovingThumbnails(unittest.TestCase): | |||
| 122 | 122 | ||
| 123 | os.remove('./tests/data/clean.cleaned.odt') | 123 | os.remove('./tests/data/clean.cleaned.odt') |
| 124 | 124 | ||
| 125 | |||
| 126 | class TestRevisionsCleaning(unittest.TestCase): | ||
| 127 | def test_libreoffice(self): | ||
| 128 | with zipfile.ZipFile('./tests/data/revision.odt') as zipin: | ||
| 129 | c = zipin.open('content.xml') | ||
| 130 | r = c.read() | ||
| 131 | self.assertIn(b'tracked-changes', r) | ||
| 132 | |||
| 133 | shutil.copy('./tests/data/revision.odt', './tests/data/clean.odt') | ||
| 134 | p = office.LibreOfficeParser('./tests/data/clean.odt') | ||
| 135 | self.assertTrue(p.remove_all()) | ||
| 136 | |||
| 137 | with zipfile.ZipFile('./tests/data/clean.cleaned.odt') as zipin: | ||
| 138 | c = zipin.open('content.xml') | ||
| 139 | r = c.read() | ||
| 140 | self.assertNotIn(b'tracked-changes', r) | ||
| 141 | |||
| 142 | os.remove('./tests/data/clean.odt') | ||
| 143 | os.remove('./tests/data/clean.cleaned.odt') | ||
| 144 | |||
| 145 | |||
| 125 | class TestDeepCleaning(unittest.TestCase): | 146 | class TestDeepCleaning(unittest.TestCase): |
| 126 | def __check_deep_meta(self, p): | 147 | def __check_deep_meta(self, p): |
| 127 | tempdir = tempfile.mkdtemp() | 148 | tempdir = tempfile.mkdtemp() |
