summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-22 11:05:26 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-24 00:01:55 -0500
commit68339b19f7ea630f003da5aa5fbb1b577a310092 (patch)
treed90c74d2be5e2b580546f481fe66b4e637926bf7
parent3a6e953fe5b51c76bb6ebb0881eaf181267112ed (diff)
downloadbuildstream-68339b19f7ea630f003da5aa5fbb1b577a310092.tar.gz
tests/testutils/runcli.py: Make get_element_states() take a list of targets
Instead of a single target, we can always provide a single target in a list.
-rw-r--r--tests/frontend/track.py4
-rw-r--r--tests/testutils/runcli.py5
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/frontend/track.py b/tests/frontend/track.py
index d149bd050..024f8e800 100644
--- a/tests/frontend/track.py
+++ b/tests/frontend/track.py
@@ -123,7 +123,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind, amount):
last_element_name = element_name
# Assert that a fetch is needed
- states = cli.get_element_states(project, last_element_name)
+ states = cli.get_element_states(project, [last_element_name])
for element_name in element_names:
assert states[element_name] == 'no reference'
@@ -143,7 +143,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind, amount):
result.assert_success()
# Assert that the base is buildable and the rest are waiting
- states = cli.get_element_states(project, last_element_name)
+ states = cli.get_element_states(project, [last_element_name])
for element_name in element_names:
if element_name == element_names[0]:
assert states[element_name] == 'buildable'
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index 7cd81e0a6..b051dec21 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -398,13 +398,12 @@ class Cli():
#
# Returns a dictionary with the element names as keys
#
- def get_element_states(self, project, target, deps='all'):
+ def get_element_states(self, project, targets, deps='all'):
result = self.run(project=project, silent=True, args=[
'show',
'--deps', deps,
'--format', '%{name}||%{state}',
- target
- ])
+ ] + targets)
result.assert_success()
lines = result.output.splitlines()
states = {}