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.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py
index 64345eb..0536646 100644
--- a/tests/test_climat2.py
+++ b/tests/test_climat2.py
@@ -1,5 +1,7 @@
1import unittest 1import os
2import shutil
2import subprocess 3import subprocess
4import unittest
3 5
4 6
5class TestHelp(unittest.TestCase): 7class TestHelp(unittest.TestCase):
@@ -14,6 +16,27 @@ class TestHelp(unittest.TestCase):
14 self.assertIn(b'usage: main.py [-h] [-c] [-l] [-s] [-L] [files [files ...]]', stdout) 16 self.assertIn(b'usage: main.py [-h] [-c] [-l] [-s] [-L] [files [files ...]]', stdout)
15 17
16 18
19class TestCleanMeta(unittest.TestCase):
20 def test_jpg(self):
21 shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg')
22
23 proc = subprocess.Popen(['./main.py', '--show', './tests/data/clean.jpg'],
24 stdout=subprocess.PIPE)
25 stdout, _ = proc.communicate()
26 self.assertIn(b'Comment: Created with GIMP', stdout)
27
28 proc = subprocess.Popen(['./main.py', './tests/data/clean.jpg'],
29 stdout=subprocess.PIPE)
30 stdout, _ = proc.communicate()
31
32 proc = subprocess.Popen(['./main.py', '--show', './tests/data/clean.jpg.cleaned'],
33 stdout=subprocess.PIPE)
34 stdout, _ = proc.communicate()
35 self.assertNotIn(b'Comment: Created with GIMP', stdout)
36
37 os.remove('./tests/data/clean.jpg')
38
39
17class TestGetMeta(unittest.TestCase): 40class TestGetMeta(unittest.TestCase):
18 def test_pdf(self): 41 def test_pdf(self):
19 proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.pdf'], 42 proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.pdf'],