summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-24 00:00:49 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-24 00:01:55 -0500
commitb7ea8b742c9c785e56103a02780df025852afb0f (patch)
tree2bda18231ae4a77c3db5fddb21b737b6cd3cb486
parent1140aed523e673f61e04ca1129cdece4142227a5 (diff)
downloadbuildstream-b7ea8b742c9c785e56103a02780df025852afb0f.tar.gz
tests/sources/remote.py: Refactored to use get_element_states()
-rw-r--r--tests/sources/remote.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/sources/remote.py b/tests/sources/remote.py
index b8cf049b3..1d7727302 100644
--- a/tests/sources/remote.py
+++ b/tests/sources/remote.py
@@ -136,18 +136,25 @@ def test_unique_key(cli, tmpdir, datafiles):
'''
project = os.path.join(datafiles.dirname, datafiles.basename)
generate_project(project, tmpdir)
- assert cli.get_element_state(project, 'target.bst') == "fetch needed"
- assert cli.get_element_state(project, 'target-custom.bst') == "fetch needed"
- assert cli.get_element_state(project, 'target-custom-executable.bst') == "fetch needed"
+ states = cli.get_element_states(project, [
+ 'target.bst', 'target-custom.bst', 'target-custom-executable.bst'
+ ])
+ assert states['target.bst'] == "fetch needed"
+ assert states['target-custom.bst'] == "fetch needed"
+ assert states['target-custom-executable.bst'] == "fetch needed"
+
# Try to fetch it
result = cli.run(project=project, args=[
'source', 'fetch', 'target.bst'
])
# We should download the file only once
- assert cli.get_element_state(project, 'target.bst') == 'buildable'
- assert cli.get_element_state(project, 'target-custom.bst') == 'buildable'
- assert cli.get_element_state(project, 'target-custom-executable.bst') == 'buildable'
+ states = cli.get_element_states(project, [
+ 'target.bst', 'target-custom.bst', 'target-custom-executable.bst'
+ ])
+ assert states['target.bst'] == 'buildable'
+ assert states['target-custom.bst'] == 'buildable'
+ assert states['target-custom-executable.bst'] == 'buildable'
# But the cache key is different because the 'filename' is different.
assert cli.get_element_key(project, 'target.bst') != \