summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-06-07 15:07:33 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-06-07 16:14:11 -0400
commit9c65b908b8dadd820bb6e0352e15a34b33137e2c (patch)
tree50b77464203b372ce55f9e8ae44dc6a2dd77e1b2
parent8234e9c7d7f989ba86e4da4acecd92f8732b003c (diff)
downloadbuildstream-9c65b908b8dadd820bb6e0352e15a34b33137e2c.tar.gz
tests/completions: Added test case for custom `bst help` completions
-rw-r--r--tests/completions/completions.py13
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)