diff options
Diffstat (limited to 'tests/test_climat2.py')
| -rw-r--r-- | tests/test_climat2.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py index 0536646..bc4a175 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py | |||
| @@ -16,6 +16,22 @@ class TestHelp(unittest.TestCase): | |||
| 16 | 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) |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | class TestReturnValue(unittest.TestCase): | ||
| 20 | def test_nonzero(self): | ||
| 21 | ret = subprocess.call(['./main.py', './main.py'], stdout=subprocess.DEVNULL) | ||
| 22 | self.assertEqual(255, ret) | ||
| 23 | |||
| 24 | ret = subprocess.call(['./main.py', '--whololo'], stderr=subprocess.DEVNULL) | ||
| 25 | self.assertEqual(2, ret) | ||
| 26 | |||
| 27 | def test_zero(self): | ||
| 28 | ret = subprocess.call(['./main.py'], stdout=subprocess.DEVNULL) | ||
| 29 | self.assertEqual(0, ret) | ||
| 30 | |||
| 31 | ret = subprocess.call(['./main.py', '--show', './main.py'], stdout=subprocess.DEVNULL) | ||
| 32 | self.assertEqual(0, ret) | ||
| 33 | |||
| 34 | |||
| 19 | class TestCleanMeta(unittest.TestCase): | 35 | class TestCleanMeta(unittest.TestCase): |
| 20 | def test_jpg(self): | 36 | def test_jpg(self): |
| 21 | shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg') | 37 | shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg') |
