diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-07 15:07:33 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-07 16:14:11 -0400 |
commit | 9c65b908b8dadd820bb6e0352e15a34b33137e2c (patch) | |
tree | 50b77464203b372ce55f9e8ae44dc6a2dd77e1b2 /tests | |
parent | 8234e9c7d7f989ba86e4da4acecd92f8732b003c (diff) | |
download | buildstream-9c65b908b8dadd820bb6e0352e15a34b33137e2c.tar.gz |
tests/completions: Added test case for custom `bst help` completions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/completions/completions.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/completions/completions.py b/tests/completions/completions.py index 239978c84..7c169c2d2 100644 --- a/tests/completions/completions.py +++ b/tests/completions/completions.py @@ -217,3 +217,16 @@ def test_argument_element(datafiles, cli, project, cmd, word_idx, expected, subd if subdir: cwd = os.path.join(cwd, subdir) assert_completion(cli, cmd, word_idx, expected, cwd=cwd) + + +@pytest.mark.parametrize("cmd,word_idx,expected", [ + ('bst he', 1, ['help ']), + ('bst help ', 2, MAIN_COMMANDS), + ('bst help fe', 2, ['fetch ']), + ('bst help p', 2, ['pull ', 'push ']), + ('bst help p', 2, ['pull ', 'push ']), + ('bst help w', 2, ['workspace ']), + ('bst help workspace ', 3, WORKSPACE_COMMANDS), +]) +def test_help_commands(cli, cmd, word_idx, expected): + assert_completion(cli, cmd, word_idx, expected) |