diff options
| author | jvoisin | 2018-10-22 13:42:04 +0200 |
|---|---|---|
| committer | jvoisin | 2018-10-22 13:42:04 +0200 |
| commit | 83389a63e9b3e145f527cccf583b30bbe1993f4c (patch) | |
| tree | cead9df89950e5c8c135043840fcc6d85777959e /tests/test_corrupted_files.py | |
| parent | e70ea811c99c16f3382c08153eda573df0825536 (diff) | |
Test mat2's reliability wrt. corrupted video files
Diffstat (limited to 'tests/test_corrupted_files.py')
| -rw-r--r-- | tests/test_corrupted_files.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py index 8d7c252..c92f0be 100644 --- a/tests/test_corrupted_files.py +++ b/tests/test_corrupted_files.py | |||
| @@ -5,7 +5,8 @@ import shutil | |||
| 5 | import os | 5 | import os |
| 6 | import logging | 6 | import logging |
| 7 | 7 | ||
| 8 | from libmat2 import pdf, images, audio, office, parser_factory, torrent, harmless | 8 | from libmat2 import pdf, images, audio, office, parser_factory, torrent |
| 9 | from libmat2 import harmless, video | ||
| 9 | 10 | ||
| 10 | # No need to logging messages, should something go wrong, | 11 | # No need to logging messages, should something go wrong, |
| 11 | # the testsuite _will_ fail. | 12 | # the testsuite _will_ fail. |
| @@ -192,3 +193,9 @@ class TestCorruptedFiles(unittest.TestCase): | |||
| 192 | with self.assertRaises(ValueError): | 193 | with self.assertRaises(ValueError): |
| 193 | images.JPGParser('./tests/data/clean.jpg') | 194 | images.JPGParser('./tests/data/clean.jpg') |
| 194 | os.remove('./tests/data/clean.jpg') | 195 | os.remove('./tests/data/clean.jpg') |
| 196 | |||
| 197 | def test_avi(self): | ||
| 198 | shutil.copy('./tests/data/dirty.torrent', './tests/data/clean.avi') | ||
| 199 | p = video.AVIParser('./tests/data/clean.avi') | ||
| 200 | self.assertFalse(p.remove_all()) | ||
| 201 | os.remove('./tests/data/clean.avi') | ||
