summaryrefslogtreecommitdiff
path: root/tests/test_libmat2.py
diff options
context:
space:
mode:
authorjvoisin2018-06-06 23:50:25 +0200
committerjvoisin2018-06-06 23:50:25 +0200
commit6a832a4104f2da3985f605e9bb973591f19d30f7 (patch)
tree0b2bd6f0612c0570fae8455698dc5c619898c36d /tests/test_libmat2.py
parentfa6c06ed8aee4530e79bc47823a3b7ca2197196d (diff)
Prevent exiftool-based parameter-injection
Diffstat (limited to 'tests/test_libmat2.py')
-rw-r--r--tests/test_libmat2.py10
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
20class 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
20class TestUnsupportedFiles(unittest.TestCase): 30class 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')