From 67ce0f739fad547a515733db4eeafde28ecc065a Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 13 Mar 2018 01:01:07 +0100 Subject: [PATCH] Add a working test --- tests/test_libmat2.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_libmat2.py 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 @@ +#!/usr/bin/python3 + +import unittest +import shutil +import os + +from src import parsers +from src.parsers import pdf + +class TestGetMeta(unittest.TestCase): + def test_pdf(self): + p = pdf.PDFParser('./tests/data/dirty.pdf') + meta = p.get_meta().items() + + +class TestCleaning(unittest.TestCase): + def setUp(self): + shutil.copy('./tests/data/dirty.pdf', './tests/data/clean.pdf') + + def tearDown(self): + #os.remove('./tests/data/clean.pdf') + pass + + def test_pdf(self): + p = pdf.PDFParser('./tests/data/clean.pdf') + p.remove_all() + #self.assertEqual(p.get_meta(), {})