From 8c7979aae3f9073cc8426613d8d7594ddb560cf7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 10 Jun 2018 20:19:35 +0200 Subject: Add some tests for non-supported embedded fileformats --- tests/data/embedded.docx | Bin 0 -> 24601 bytes tests/data/embedded.odt | Bin 0 -> 33019 bytes tests/test_libmat2.py | 13 +++++++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/data/embedded.docx create mode 100644 tests/data/embedded.odt (limited to 'tests') diff --git a/tests/data/embedded.docx b/tests/data/embedded.docx new file mode 100644 index 0000000..b134724 Binary files /dev/null and b/tests/data/embedded.docx differ diff --git a/tests/data/embedded.odt b/tests/data/embedded.odt new file mode 100644 index 0000000..62bf8cc Binary files /dev/null and b/tests/data/embedded.odt differ diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 7deeadc..c85f425 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py @@ -27,6 +27,19 @@ class TestParameterInjection(unittest.TestCase): os.remove('-ver') +class TestUnsupportedEmbeddedFiles(unittest.TestCase): + def test_odt_with_svg(self): + shutil.copy('./tests/data/embedded.odt', './tests/data/clean.odt') + p = office.LibreOfficeParser('./tests/data/clean.odt') + self.assertFalse(p.remove_all()) + os.remove('./tests/data/clean.odt') + + def test_docx_with_svg(self): + shutil.copy('./tests/data/embedded.docx', './tests/data/clean.docx') + p = office.MSOfficeParser('./tests/data/clean.docx') + self.assertFalse(p.remove_all()) + os.remove('./tests/data/clean.docx') + class TestUnsupportedFiles(unittest.TestCase): def test_pdf(self): shutil.copy('./tests/test_libmat2.py', './tests/clean.py') -- cgit v1.3