From cfc3a58550704f86cc5db1d1ba37ef2a7d68dca0 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 23 Apr 2018 00:28:36 +0200 Subject: Add a test for odg --- tests/test_libmat2.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test_libmat2.py') 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): self.assertEqual(p.get_meta(), {}) os.remove('./tests/data/clean.odf') + + + def test_odg(self): + shutil.copy('./tests/data/dirty.odg', './tests/data/clean.odg') + p = office.LibreOfficeParser('./tests/data/clean.odg') + + meta = p.get_meta() + self.assertEqual(meta['dc:date'], '2018-04-23T00:26:59.385838550') + + ret = p.remove_all() + self.assertTrue(ret) + + p = office.LibreOfficeParser('./tests/data/clean.odg.cleaned') + self.assertEqual(p.get_meta(), {}) + + os.remove('./tests/data/clean.odg') -- cgit v1.3