summaryrefslogtreecommitdiff
path: root/tests/completions/completions.py
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2018-12-14 20:07:13 +0000
committerChandan Singh <chandan@chandansingh.net>2018-12-14 20:07:13 +0000
commitb23bec551839e4d652a23a349fed96c885d7f7f5 (patch)
tree51769992543be2904577a9e512421e7f9f651818 /tests/completions/completions.py
parent13eb7ed2f356e1f42a8d379e313d55c5d3875d34 (diff)
parentf894c0a80fab5434bb94b152e958880cc8f4f9d9 (diff)
downloadbuildstream-b23bec551839e4d652a23a349fed96c885d7f7f5.tar.gz
Merge branch 'chandan/source-subgroup' into 'master'
Introduce new "source" command group Closes #814 See merge request BuildStream/buildstream!1003
Diffstat (limited to 'tests/completions/completions.py')
-rw-r--r--tests/completions/completions.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/completions/completions.py b/tests/completions/completions.py
index f810c4f08..372ed7840 100644
--- a/tests/completions/completions.py
+++ b/tests/completions/completions.py
@@ -9,15 +9,13 @@ MAIN_COMMANDS = [
'artifact ',
'build ',
'checkout ',
- 'fetch ',
'help ',
'init ',
'pull ',
'push ',
'shell ',
'show ',
- 'source-checkout ',
- 'track ',
+ 'source ',
'workspace '
]
@@ -50,6 +48,12 @@ MAIN_OPTIONS = [
"--version ",
]
+SOURCE_COMMANDS = [
+ 'checkout ',
+ 'fetch ',
+ 'track ',
+]
+
WORKSPACE_COMMANDS = [
'close ',
'list ',
@@ -115,6 +119,7 @@ def assert_completion_failed(cli, cmd, word_idx, expected, cwd=None):
('bst ', 1, MAIN_COMMANDS),
('bst pu', 1, ['pull ', 'push ']),
('bst pul', 1, ['pull ']),
+ ('bst source ', 2, SOURCE_COMMANDS),
('bst w ', 1, ['workspace ']),
('bst workspace ', 2, WORKSPACE_COMMANDS),
])
@@ -267,9 +272,10 @@ def test_argument_element_invalid(datafiles, cli, project, cmd, word_idx, expect
@pytest.mark.parametrize("cmd,word_idx,expected", [
('bst he', 1, ['help ']),
('bst help ', 2, MAIN_COMMANDS),
- ('bst help fe', 2, ['fetch ']),
+ ('bst help in', 2, ['init ']),
('bst help p', 2, ['pull ', 'push ']),
('bst help p', 2, ['pull ', 'push ']),
+ ('bst help source ', 3, SOURCE_COMMANDS),
('bst help w', 2, ['workspace ']),
('bst help workspace ', 3, WORKSPACE_COMMANDS),
])