Add a test for odg
This commit is contained in:
parent
0fa184cb6f
commit
cfc3a58550
3 changed files with 17 additions and 0 deletions
BIN
tests/data/dirty.odg
Normal file
BIN
tests/data/dirty.odg
Normal file
Binary file not shown.
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue