summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/dirty.odfbin0 -> 4861 bytes
-rw-r--r--tests/test_libmat2.py16
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/data/dirty.odf b/tests/data/dirty.odf
new file mode 100644
index 0000000..49da2bc
--- /dev/null
+++ b/tests/data/dirty.odf
Binary files differ
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
index ff5c196..6efaf31 100644
--- a/tests/test_libmat2.py
+++ b/tests/test_libmat2.py
@@ -328,7 +328,6 @@ class TestCleaning(unittest.TestCase):
328 328
329 os.remove('./tests/data/clean.bmp') 329 os.remove('./tests/data/clean.bmp')
330 330
331
332 def test_torrent(self): 331 def test_torrent(self):
333 shutil.copy('./tests/data/dirty.torrent', './tests/data/clean.torrent') 332 shutil.copy('./tests/data/dirty.torrent', './tests/data/clean.torrent')
334 p = torrent.TorrentParser('./tests/data/clean.torrent') 333 p = torrent.TorrentParser('./tests/data/clean.torrent')
@@ -343,3 +342,18 @@ class TestCleaning(unittest.TestCase):
343 self.assertEqual(p.get_meta(), {}) 342 self.assertEqual(p.get_meta(), {})
344 343
345 os.remove('./tests/data/clean.torrent') 344 os.remove('./tests/data/clean.torrent')
345
346 def test_odf(self):
347 shutil.copy('./tests/data/dirty.odf', './tests/data/clean.odf')
348 p = office.LibreOfficeParser('./tests/data/clean.odf')
349
350 meta = p.get_meta()
351 self.assertEqual(meta['meta:creation-date'], '2018-04-23T00:18:59.438231281')
352
353 ret = p.remove_all()
354 self.assertTrue(ret)
355
356 p = office.LibreOfficeParser('./tests/data/clean.odf.cleaned')
357 self.assertEqual(p.get_meta(), {})
358
359 os.remove('./tests/data/clean.odf')