diff options
| author | jvoisin | 2018-05-16 22:10:47 +0200 |
|---|---|---|
| committer | jvoisin | 2018-05-16 22:10:47 +0200 |
| commit | 0354c3b7e3a455cce130b6226926436a21128641 (patch) | |
| tree | dd85bb61c96457efa723394de2065af349750fa1 /tests | |
| parent | effe68f08f19ff26c37ede5a7a92d5d4452434fe (diff) | |
Add a test about unsupported files
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_libmat2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 17afaf4..f3e11d9 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -16,6 +16,16 @@ 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 | |||
| 20 | class TestUnsupportedFiles(unittest.TestCase): | ||
| 21 | def test_pdf(self): | ||
| 22 | shutil.copy('./tests/test_libmat2.py', './tests/clean.py') | ||
| 23 | parser, mimetype = parser_factory.get_parser('./tests/data/clean.py') | ||
| 24 | self.assertEqual(mimetype, 'text/x-python') | ||
| 25 | self.assertEqual(parser, None) | ||
| 26 | os.remove('./tests/clean.py') | ||
| 27 | |||
| 28 | |||
| 19 | class TestCorruptedFiles(unittest.TestCase): | 29 | class TestCorruptedFiles(unittest.TestCase): |
| 20 | def test_pdf(self): | 30 | def test_pdf(self): |
| 21 | shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') | 31 | shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') |
