summaryrefslogtreecommitdiff
path: root/tests/test_libmat2.py
diff options
context:
space:
mode:
authorjvoisin2018-05-06 21:58:31 +0200
committerjvoisin2018-05-06 21:58:31 +0200
commitb02d72887afd4498b03cdd767ca46676fb150622 (patch)
tree9e10596ac428a4fce2b7da14ee8fb972ff826a68 /tests/test_libmat2.py
parent459e9b82f76d9aa5c93c288d2ce7b8be34c601b4 (diff)
Test for faulty files, and document how MAT2 is behaving wrt. them
Diffstat (limited to 'tests/test_libmat2.py')
-rw-r--r--tests/test_libmat2.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
index 1950444..17afaf4 100644
--- a/tests/test_libmat2.py
+++ b/tests/test_libmat2.py
@@ -16,6 +16,18 @@ class TestParserFactory(unittest.TestCase):
16 self.assertEqual(mimetype, 'audio/mpeg') 16 self.assertEqual(mimetype, 'audio/mpeg')
17 self.assertEqual(parser.__class__, audio.MP3Parser) 17 self.assertEqual(parser.__class__, audio.MP3Parser)
18 18
19class TestCorruptedFiles(unittest.TestCase):
20 def test_pdf(self):
21 shutil.copy('./tests/data/dirty.png', './tests/data/clean.png')
22 with self.assertRaises(ValueError):
23 pdf.PDFParser('./tests/data/clean.png')
24 os.remove('./tests/data/clean.png')
25
26 def test_png(self):
27 shutil.copy('./tests/data/dirty.pdf', './tests/data/clean.pdf')
28 with self.assertRaises(ValueError):
29 images.PNGParser('./tests/data/clean.pdf')
30 os.remove('./tests/data/clean.pdf')
19 31
20class TestGetMeta(unittest.TestCase): 32class TestGetMeta(unittest.TestCase):
21 def test_pdf(self): 33 def test_pdf(self):