summaryrefslogtreecommitdiff
path: root/tests/frontend/track.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-24 00:01:17 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-24 00:01:56 -0500
commit83fcaa9f7d55f017c64c02bef5a47d1e455340ec (patch)
treeb6a51ae183f142ec4dcdc672bddba628179bce85 /tests/frontend/track.py
parent21b2958bb173689a8b5d9868dcb7dde5a2cf692f (diff)
downloadbuildstream-83fcaa9f7d55f017c64c02bef5a47d1e455340ec.tar.gz
tests/frontend/track.py: Refactored to use get_element_states()
Diffstat (limited to 'tests/frontend/track.py')
-rw-r--r--tests/frontend/track.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/frontend/track.py b/tests/frontend/track.py
index 024f8e800..8857294ac 100644
--- a/tests/frontend/track.py
+++ b/tests/frontend/track.py
@@ -171,8 +171,9 @@ def test_track_single(cli, tmpdir, datafiles):
dep_name=element_dep_name)
# Assert that tracking is needed for both elements
- assert cli.get_element_state(project, element_dep_name) == 'no reference'
- assert cli.get_element_state(project, element_target_name) == 'no reference'
+ states = cli.get_element_states(project, [element_target_name])
+ assert states[element_dep_name] == 'no reference'
+ assert states[element_target_name] == 'no reference'
# Now first try to track only one element
result = cli.run(project=project, args=[
@@ -187,8 +188,9 @@ def test_track_single(cli, tmpdir, datafiles):
result.assert_success()
# Assert that the dependency is waiting and the target has still never been tracked
- assert cli.get_element_state(project, element_dep_name) == 'no reference'
- assert cli.get_element_state(project, element_target_name) == 'waiting'
+ states = cli.get_element_states(project, [element_target_name])
+ assert states[element_dep_name] == 'no reference'
+ assert states[element_target_name] == 'waiting'
@pytest.mark.datafiles(DATA_DIR)
@@ -212,8 +214,9 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
dep_name=element_dep_name)
# Assert that a fetch is needed
- assert cli.get_element_state(project, element_dep_name) == 'no reference'
- assert cli.get_element_state(project, element_target_name) == 'no reference'
+ states = cli.get_element_states(project, [element_target_name])
+ assert states[element_dep_name] == 'no reference'
+ assert states[element_target_name] == 'no reference'
# Now first try to track it
result = cli.run(project=project, args=[
@@ -231,8 +234,9 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
result.assert_success()
# Assert that the dependency is buildable and the target is waiting
- assert cli.get_element_state(project, element_dep_name) == 'no reference'
- assert cli.get_element_state(project, element_target_name) == 'waiting'
+ states = cli.get_element_states(project, [element_target_name])
+ assert states[element_dep_name] == 'no reference'
+ assert states[element_target_name] == 'waiting'
@pytest.mark.datafiles(os.path.join(TOP_DIR))