From 21b2958bb173689a8b5d9868dcb7dde5a2cf692f Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Thu, 24 Jan 2019 00:01:08 -0500 Subject: tests/frontend/push.py: Refactored to use get_element_states() --- tests/frontend/push.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 6ed163a93..f3f9b52f1 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -250,9 +250,10 @@ def test_artifact_expires(cli, datafiles, tmpdir): result.assert_success() # check that element's 1 and 2 are cached both locally and remotely - assert cli.get_element_state(project, 'element1.bst') == 'cached' + states = cli.get_element_states(project, ['element1.bst', 'element2.bst']) + assert states['element1.bst'] == 'cached' + assert states['element2.bst'] == 'cached' assert_shared(cli, share, project, 'element1.bst') - assert cli.get_element_state(project, 'element2.bst') == 'cached' assert_shared(cli, share, project, 'element2.bst') # Create and build another element of 5 MB (This will exceed the free disk space available) @@ -298,11 +299,12 @@ def test_artifact_too_large(cli, datafiles, tmpdir): result.assert_success() # Ensure that the small artifact is still in the share - assert cli.get_element_state(project, 'small_element.bst') == 'cached' + states = cli.get_element_states(project, ['small_element.bst', 'large_element.bst']) + states['small_element.bst'] == 'cached' assert_shared(cli, share, project, 'small_element.bst') # Ensure that the artifact is cached locally but NOT remotely - assert cli.get_element_state(project, 'large_element.bst') == 'cached' + states['large_element.bst'] == 'cached' assert_not_shared(cli, share, project, 'large_element.bst') @@ -334,8 +336,9 @@ def test_recently_pulled_artifact_does_not_expire(cli, datafiles, tmpdir): result.assert_success() # Ensure they are cached locally - assert cli.get_element_state(project, 'element1.bst') == 'cached' - assert cli.get_element_state(project, 'element2.bst') == 'cached' + states = cli.get_element_states(project, ['element1.bst', 'element2.bst']) + assert states['element1.bst'] == 'cached' + assert states['element2.bst'] == 'cached' # Ensure that they have been pushed to the cache assert_shared(cli, share, project, 'element1.bst') -- cgit v1.2.1