diff options
| author | jvoisin | 2019-12-23 23:10:39 +0100 |
|---|---|---|
| committer | jvoisin | 2019-12-23 23:10:39 +0100 |
| commit | 0902e9e330db3e85013a669f1e7aae51183ac581 (patch) | |
| tree | 50af2c250e309d0d3607c49efb1d27de49571cec /tests/test_climat2.py | |
| parent | b2efffdaa4fc90bb509d09459926db0842a9e258 (diff) | |
Make the testsuite a bit more robust
Some terminals with a small number of column
could wrap the cli's output in a way that
would make the testsuite fail.
This commit break the tests in several smaller one
to mitigate this.
This issue was originally reported by eleius
[here](https://github.com/actionless/pikaur/issues/433), and forwarded as #153.
Diffstat (limited to 'tests/test_climat2.py')
| -rw-r--r-- | tests/test_climat2.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py index 8ab7cbd..7b07a1d 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py | |||
| @@ -22,16 +22,22 @@ class TestHelp(unittest.TestCase): | |||
| 22 | def test_help(self): | 22 | def test_help(self): |
| 23 | proc = subprocess.Popen(mat2_binary + ['--help'], stdout=subprocess.PIPE) | 23 | proc = subprocess.Popen(mat2_binary + ['--help'], stdout=subprocess.PIPE) |
| 24 | stdout, _ = proc.communicate() | 24 | stdout, _ = proc.communicate() |
| 25 | self.assertIn(b'mat2 [-h] [-V] [--unknown-members policy] [--inplace] [--no-sandbox]', | 25 | self.assertIn(b'mat2 [-h] [-V]', stdout) |
| 26 | stdout) | 26 | self.assertIn(b'[--unknown-members policy]', stdout) |
| 27 | self.assertIn(b' [-v] [-l] [--check-dependencies] [-L | -s]', stdout) | 27 | self.assertIn(b'[--inplace]', stdout) |
| 28 | self.assertIn(b'[--no-sandbox]', stdout) | ||
| 29 | self.assertIn(b' [-v] [-l]', stdout) | ||
| 30 | self.assertIn(b'[--check-dependencies]', stdout) | ||
| 31 | self.assertIn(b'[-L | -s]', stdout) | ||
| 28 | self.assertIn(b'[files [files ...]]', stdout) | 32 | self.assertIn(b'[files [files ...]]', stdout) |
| 29 | 33 | ||
| 30 | def test_no_arg(self): | 34 | def test_no_arg(self): |
| 31 | proc = subprocess.Popen(mat2_binary, stdout=subprocess.PIPE) | 35 | proc = subprocess.Popen(mat2_binary, stdout=subprocess.PIPE) |
| 32 | stdout, _ = proc.communicate() | 36 | stdout, _ = proc.communicate() |
| 33 | self.assertIn(b'mat2 [-h] [-V] [--unknown-members policy] [--inplace] [--no-sandbox]', | 37 | self.assertIn(b'mat2 [-h] [-V]', stdout) |
| 34 | stdout) | 38 | self.assertIn(b'[--unknown-members policy]', stdout) |
| 39 | self.assertIn(b'[--inplace]', stdout) | ||
| 40 | self.assertIn(b'[--no-sandbox]', stdout) | ||
| 35 | self.assertIn(b' [-v] [-l] [--check-dependencies] [-L | -s]', stdout) | 41 | self.assertIn(b' [-v] [-l] [--check-dependencies] [-L | -s]', stdout) |
| 36 | self.assertIn(b'[files [files ...]]', stdout) | 42 | self.assertIn(b'[files [files ...]]', stdout) |
| 37 | 43 | ||
