diff options
| author | jvoisin | 2018-06-06 23:50:25 +0200 |
|---|---|---|
| committer | jvoisin | 2018-06-06 23:50:25 +0200 |
| commit | 6a832a4104f2da3985f605e9bb973591f19d30f7 (patch) | |
| tree | 0b2bd6f0612c0570fae8455698dc5c619898c36d /tests | |
| parent | fa6c06ed8aee4530e79bc47823a3b7ca2197196d (diff) | |
Prevent exiftool-based parameter-injection
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 89a5811..84eb75e 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -17,6 +17,16 @@ class TestParserFactory(unittest.TestCase): | |||
| 17 | self.assertEqual(parser.__class__, audio.MP3Parser) | 17 | self.assertEqual(parser.__class__, audio.MP3Parser) |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | class TestParameterInjection(unittest.TestCase): | ||
| 21 | def test_ver_injection(self): | ||
| 22 | shutil.copy('./tests/data/dirty.png', './-ver') | ||
| 23 | p = images.PNGParser('-ver') | ||
| 24 | meta = p.get_meta() | ||
| 25 | self.assertEqual(meta['Comment'], 'This is a comment, be careful!') | ||
| 26 | self.assertEqual(meta['ModifyDate'], "2018:03:20 21:59:25") | ||
| 27 | os.remove('-ver') | ||
| 28 | |||
| 29 | |||
| 20 | class TestUnsupportedFiles(unittest.TestCase): | 30 | class TestUnsupportedFiles(unittest.TestCase): |
| 21 | def test_pdf(self): | 31 | def test_pdf(self): |
| 22 | shutil.copy('./tests/test_libmat2.py', './tests/clean.py') | 32 | shutil.copy('./tests/test_libmat2.py', './tests/clean.py') |
