summaryrefslogtreecommitdiff
path: root/tests/test_climat2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_climat2.py')
-rw-r--r--tests/test_climat2.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py
index 9d816b1..17fce82 100644
--- a/tests/test_climat2.py
+++ b/tests/test_climat2.py
@@ -1,6 +1,7 @@
1import random 1import random
2import os 2import os
3import shutil 3import shutil
4import stat
4import subprocess 5import subprocess
5import unittest 6import unittest
6import glob 7import glob
@@ -132,6 +133,33 @@ class TestCleanMeta(unittest.TestCase):
132 self.assertNotIn(b'Comment: Created with GIMP', stdout) 133 self.assertNotIn(b'Comment: Created with GIMP', stdout)
133 134
134 os.remove('./tests/data/clean.jpg') 135 os.remove('./tests/data/clean.jpg')
136 os.remove('./tests/data/clean.cleaned.jpg')
137
138
139class TestCopyPermissions(unittest.TestCase):
140 def test_jpg_777(self):
141 shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg')
142 os.chmod('./tests/data/clean.jpg', 0o777)
143
144 proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/clean.jpg'],
145 stdout=subprocess.PIPE)
146 stdout, _ = proc.communicate()
147 self.assertIn(b'Comment: Created with GIMP', stdout)
148
149 proc = subprocess.Popen(mat2_binary + ['./tests/data/clean.jpg'],
150 stdout=subprocess.PIPE)
151 stdout, _ = proc.communicate()
152
153 proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/clean.cleaned.jpg'],
154 stdout=subprocess.PIPE)
155 stdout, _ = proc.communicate()
156 self.assertNotIn(b'Comment: Created with GIMP', stdout)
157
158 permissions = os.stat('./tests/data/clean.cleaned.jpg')[stat.ST_MODE]
159 self.assertEqual(permissions, 0o100777)
160
161 os.remove('./tests/data/clean.jpg')
162 os.remove('./tests/data/clean.cleaned.jpg')
135 163
136 164
137class TestIsSupported(unittest.TestCase): 165class TestIsSupported(unittest.TestCase):