summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-06-06 19:21:14 +0100
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-06-06 22:10:49 +0000
commit69e594433df417324f4015c0364088acfacc1a72 (patch)
treee1947b6a92e1fec9502b4122f2fdd2ff5a0f9120 /tests
parenta5ff465d9225ad894435f95ec03f6ee21968fcb1 (diff)
downloadbuildstream-69e594433df417324f4015c0364088acfacc1a72.tar.gz
_frontend/cli.py: Try to autocomplete element paths when running from a subdirectory
The previous commit added support for running bst commands form subdirectories of the project root. Make autocomplete also work in a similar way.
Diffstat (limited to 'tests')
-rw-r--r--tests/completions/completions.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/completions/completions.py b/tests/completions/completions.py
index cc98cb940..d6d0fde81 100644
--- a/tests/completions/completions.py
+++ b/tests/completions/completions.py
@@ -174,8 +174,9 @@ def test_option_directory(datafiles, cli, cmd, word_idx, expected, subdir):
['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], None),
# When running from the files subdir
- ('project', 'bst show ', 2, [], 'files'),
- ('project', 'bst build com', 2, [], 'files'),
+ ('project', 'bst show ', 2, [e + ' ' for e in PROJECT_ELEMENTS], 'files'),
+ ('project', 'bst build com', 2,
+ ['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], 'files'),
# When passing the project directory
('project', 'bst --directory ../ show ', 4, [e + ' ' for e in PROJECT_ELEMENTS], 'files'),
@@ -193,8 +194,10 @@ def test_option_directory(datafiles, cli, cmd, word_idx, expected, subdir):
['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], None),
# When running from the files subdir
- ('no-element-path', 'bst show ', 2, [], 'files'),
- ('no-element-path', 'bst build com', 2, [], 'files'),
+ ('no-element-path', 'bst show ', 2,
+ [e + ' ' for e in (PROJECT_ELEMENTS + ['project.conf'])] + ['files/'], 'files'),
+ ('no-element-path', 'bst build com', 2,
+ ['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], 'files'),
# When passing the project directory
('no-element-path', 'bst --directory ../ show ', 4,