diff options
| author | jvoisin | 2018-03-13 01:01:07 +0100 |
|---|---|---|
| committer | jvoisin | 2018-03-13 01:01:07 +0100 |
| commit | 67ce0f739fad547a515733db4eeafde28ecc065a (patch) | |
| tree | 28ed7e788b3c97e6c005a062070880fb2a93a39e /tests/test_libmat2.py | |
| parent | 13d2507d605ca418dfe8abbb63f5de69cd8a6bec (diff) | |
Add a working test
Diffstat (limited to 'tests/test_libmat2.py')
| -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(), {}) | ||
