diff options
| -rw-r--r-- | src/office.py | 1 | ||||
| -rw-r--r-- | tests/data/dirty.odg | bin | 0 -> 8992 bytes | |||
| -rw-r--r-- | tests/test_libmat2.py | 16 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/office.py b/src/office.py index 5509c6e..da6168e 100644 --- a/src/office.py +++ b/src/office.py | |||
| @@ -109,6 +109,7 @@ class LibreOfficeParser(ArchiveBasedAbstractParser): | |||
| 109 | 'application/vnd.oasis.opendocument.graphics', | 109 | 'application/vnd.oasis.opendocument.graphics', |
| 110 | 'application/vnd.oasis.opendocument.chart', | 110 | 'application/vnd.oasis.opendocument.chart', |
| 111 | 'application/vnd.oasis.opendocument.formula', | 111 | 'application/vnd.oasis.opendocument.formula', |
| 112 | 'application/vnd.oasis.opendocument.image', | ||
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | def get_meta(self): | 115 | def get_meta(self): |
diff --git a/tests/data/dirty.odg b/tests/data/dirty.odg new file mode 100644 index 0000000..8605c9c --- /dev/null +++ b/tests/data/dirty.odg | |||
| Binary files differ | |||
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 6efaf31..31a3143 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -357,3 +357,19 @@ class TestCleaning(unittest.TestCase): | |||
| 357 | self.assertEqual(p.get_meta(), {}) | 357 | self.assertEqual(p.get_meta(), {}) |
| 358 | 358 | ||
| 359 | os.remove('./tests/data/clean.odf') | 359 | os.remove('./tests/data/clean.odf') |
| 360 | |||
| 361 | |||
| 362 | def test_odg(self): | ||
| 363 | shutil.copy('./tests/data/dirty.odg', './tests/data/clean.odg') | ||
| 364 | p = office.LibreOfficeParser('./tests/data/clean.odg') | ||
| 365 | |||
| 366 | meta = p.get_meta() | ||
| 367 | self.assertEqual(meta['dc:date'], '2018-04-23T00:26:59.385838550') | ||
| 368 | |||
| 369 | ret = p.remove_all() | ||
| 370 | self.assertTrue(ret) | ||
| 371 | |||
| 372 | p = office.LibreOfficeParser('./tests/data/clean.odg.cleaned') | ||
| 373 | self.assertEqual(p.get_meta(), {}) | ||
| 374 | |||
| 375 | os.remove('./tests/data/clean.odg') | ||
