diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_libmat2.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py new file mode 100644 index 0000000..56b960e --- /dev/null +++ b/tests/test_libmat2.py | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | |||
| 3 | import unittest | ||
| 4 | import shutil | ||
| 5 | import os | ||
| 6 | |||
| 7 | from src import parsers | ||
| 8 | from src.parsers import pdf | ||
| 9 | |||
| 10 | class TestGetMeta(unittest.TestCase): | ||
| 11 | def test_pdf(self): | ||
| 12 | p = pdf.PDFParser('./tests/data/dirty.pdf') | ||
| 13 | meta = p.get_meta().items() | ||
| 14 | |||
| 15 | |||
| 16 | class TestCleaning(unittest.TestCase): | ||
| 17 | def setUp(self): | ||
| 18 | shutil.copy('./tests/data/dirty.pdf', './tests/data/clean.pdf') | ||
| 19 | |||
| 20 | def tearDown(self): | ||
| 21 | #os.remove('./tests/data/clean.pdf') | ||
| 22 | pass | ||
| 23 | |||
| 24 | def test_pdf(self): | ||
| 25 | p = pdf.PDFParser('./tests/data/clean.pdf') | ||
| 26 | p.remove_all() | ||
| 27 | #self.assertEqual(p.get_meta(), {}) | ||
