diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_libmat2.py | 12 |
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 | ||
| 19 | class 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 | ||
| 20 | class TestGetMeta(unittest.TestCase): | 32 | class TestGetMeta(unittest.TestCase): |
| 21 | def test_pdf(self): | 33 | def test_pdf(self): |
