Skip to content
Snippets Groups Projects
Commit b5a9520a authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Add a cli-related test

parent a1257c53
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment