summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjvoisin2018-05-16 00:07:04 +0200
committerjvoisin2018-05-16 00:07:04 +0200
commitbe6d32afa830fd5b4e7dee5b649c83523a59e04d (patch)
treec6f5dc0c9d528f678a947c6ea155042041530524 /tests
parent7b0a27ce76ab178faade2ed8aeb29383c9c0687c (diff)
Some arguments are mutually exclusives
Diffstat (limited to 'tests')
-rw-r--r--tests/test_climat2.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py
index 67b56eb..864ee0d 100644
--- a/tests/test_climat2.py
+++ b/tests/test_climat2.py
@@ -8,12 +8,12 @@ class TestHelp(unittest.TestCase):
8 def test_help(self): 8 def test_help(self):
9 proc = subprocess.Popen(['./main.py', '--help'], stdout=subprocess.PIPE) 9 proc = subprocess.Popen(['./main.py', '--help'], stdout=subprocess.PIPE)
10 stdout, _ = proc.communicate() 10 stdout, _ = proc.communicate()
11 self.assertIn(b'usage: main.py [-h] [-v] [-c] [-l] [-s] [-L] [files [files ...]]', stdout) 11 self.assertIn(b'usage: main.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
12 12
13 def test_no_arg(self): 13 def test_no_arg(self):
14 proc = subprocess.Popen(['./main.py'], stdout=subprocess.PIPE) 14 proc = subprocess.Popen(['./main.py'], stdout=subprocess.PIPE)
15 stdout, _ = proc.communicate() 15 stdout, _ = proc.communicate()
16 self.assertIn(b'usage: main.py [-h] [-v] [-c] [-l] [-s] [-L] [files [files ...]]', stdout) 16 self.assertIn(b'usage: main.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
17 17
18 18
19class TestVersion(unittest.TestCase): 19class TestVersion(unittest.TestCase):
@@ -23,6 +23,12 @@ class TestVersion(unittest.TestCase):
23 self.assertTrue(stdout.startswith(b'MAT2 ')) 23 self.assertTrue(stdout.startswith(b'MAT2 '))
24 24
25 25
26class TestExclusiveArgs(unittest.TestCase):
27 def test_version(self):
28 proc = subprocess.Popen(['./main.py', '-s', '-c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
29 stdout, stderr = proc.communicate()
30 self.assertIn(b'main.py: error: argument -c/--check: not allowed with argument -s/--show', stderr)
31
26 32
27class TestReturnValue(unittest.TestCase): 33class TestReturnValue(unittest.TestCase):
28 def test_nonzero(self): 34 def test_nonzero(self):