diff --git a/tests/test_climat2.py b/tests/test_climat2.py
index 99f9b9cad5b381dc74eb77d92ccc5108061b56ca..e65e47ffb559fa13ac8f33b1db7c94aad9f77849 100644
--- a/tests/test_climat2.py
+++ b/tests/test_climat2.py
@@ -44,6 +44,33 @@ class TestReturnValue(unittest.TestCase):
self.assertEqual(0, ret)
+class TestCleanFolder(unittest.TestCase):
+ def test_jpg(self):
+ os.mkdir('./tests/data/folder/')
+ shutil.copy('./tests/data/dirty.jpg', './tests/data/folder/clean1.jpg')
+ shutil.copy('./tests/data/dirty.jpg', './tests/data/folder/clean2.jpg')
+
+ proc = subprocess.Popen(['./mat2', '--show', './tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Comment: Created with GIMP', stdout)
+
+ proc = subprocess.Popen(['./mat2', './tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+
+ os.remove('./tests/data/folder/clean1.jpg')
+ os.remove('./tests/data/folder/clean2.jpg')
+
+ proc = subprocess.Popen(['./mat2', '--show', './tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertNotIn(b'Comment: Created with GIMP', stdout)
+
+ shutil.rmtree('./tests/data/folder/')
+
+
+
class TestCleanMeta(unittest.TestCase):
def test_jpg(self):
shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg')