diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/data/embedded.docx | bin | 0 -> 24601 bytes | |||
| -rw-r--r-- | tests/data/embedded.odt | bin | 0 -> 33019 bytes | |||
| -rw-r--r-- | tests/test_libmat2.py | 13 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/data/embedded.docx b/tests/data/embedded.docx new file mode 100644 index 0000000..b134724 --- /dev/null +++ b/tests/data/embedded.docx | |||
| Binary files differ | |||
diff --git a/tests/data/embedded.odt b/tests/data/embedded.odt new file mode 100644 index 0000000..62bf8cc --- /dev/null +++ b/tests/data/embedded.odt | |||
| Binary files 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): | |||
| 27 | os.remove('-ver') | 27 | os.remove('-ver') |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | class TestUnsupportedEmbeddedFiles(unittest.TestCase): | ||
| 31 | def test_odt_with_svg(self): | ||
| 32 | shutil.copy('./tests/data/embedded.odt', './tests/data/clean.odt') | ||
| 33 | p = office.LibreOfficeParser('./tests/data/clean.odt') | ||
| 34 | self.assertFalse(p.remove_all()) | ||
| 35 | os.remove('./tests/data/clean.odt') | ||
| 36 | |||
| 37 | def test_docx_with_svg(self): | ||
| 38 | shutil.copy('./tests/data/embedded.docx', './tests/data/clean.docx') | ||
| 39 | p = office.MSOfficeParser('./tests/data/clean.docx') | ||
| 40 | self.assertFalse(p.remove_all()) | ||
| 41 | os.remove('./tests/data/clean.docx') | ||
| 42 | |||
| 30 | class TestUnsupportedFiles(unittest.TestCase): | 43 | class TestUnsupportedFiles(unittest.TestCase): |
| 31 | def test_pdf(self): | 44 | def test_pdf(self): |
| 32 | shutil.copy('./tests/test_libmat2.py', './tests/clean.py') | 45 | shutil.copy('./tests/test_libmat2.py', './tests/clean.py') |
