From 8aa2fbc98b57a8c3f9392bb12ca77b0f47a7d602 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 5 Dec 2017 18:38:13 +0000 Subject: tests/frontend: Reverse ordering of cache specifications The cache parameters are now in highest-to-lowest precidence order corresponding to left-to-right along the line where they are specified. Once we make it possible to specify a list of URLs for each of these parameters, the precidence will continue to always read from highest to lowest corresponding to left-to-right since each list of URLs will also read left-to-right. --- tests/frontend/pull.py | 14 +++++++------- tests/frontend/push.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/frontend/pull.py b/tests/frontend/pull.py index 116bc9e49..96e1c68a5 100644 --- a/tests/frontend/pull.py +++ b/tests/frontend/pull.py @@ -27,14 +27,14 @@ def assert_shared(cli, share, project, element_name): @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.parametrize( - 'user_url, project_url, override_url', + 'override_url, project_url, user_url', [ - pytest.param('share.repo', '', '', id='user-config'), - pytest.param('/tmp/share/user', 'share.repo', '', id='project-config'), - pytest.param('/tmp/share/user', '/tmp/share/project', 'share.repo', id='project-override-in-user-config'), + pytest.param('', '', 'share.repo', id='user-config'), + pytest.param('', 'share.repo', '/tmp/share/user', id='project-config'), + pytest.param('share.repo', '/tmp/share/project', '/tmp/share/user', id='project-override-in-user-config'), ]) @pytest.mark.datafiles(DATA_DIR) -def test_push_pull(cli, tmpdir, datafiles, user_url, project_url, override_url): +def test_push_pull(cli, tmpdir, datafiles, override_url, project_url, user_url): project = os.path.join(datafiles.dirname, datafiles.basename) share = create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) @@ -46,9 +46,9 @@ def test_push_pull(cli, tmpdir, datafiles, user_url, project_url, override_url): state = cli.get_element_state(project, 'import-bin.bst') assert state == 'cached' - user_url = share.repo if user_url == 'share.repo' else user_url - project_url = share.repo if project_url == 'share.repo' else project_url override_url = share.repo if override_url == 'share.repo' else override_url + project_url = share.repo if project_url == 'share.repo' else project_url + user_url = share.repo if user_url == 'share.repo' else user_url # Configure artifact share cli.configure({ diff --git a/tests/frontend/push.py b/tests/frontend/push.py index d4ae6c6dc..ced42acf3 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -26,14 +26,14 @@ def assert_shared(cli, share, project, element_name): @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.parametrize( - 'user_url, project_url, override_url', + 'override_url, project_url, user_url', [ - pytest.param('share.repo', '', '', id='user-config'), - pytest.param('/tmp/share/user', 'share.repo', '', id='project-config'), - pytest.param('/tmp/share/user', '/tmp/share/project', 'share.repo', id='project-override-in-user-config'), + pytest.param('', '', 'share.repo', id='user-config'), + pytest.param('', 'share.repo', '/tmp/share/user', id='project-config'), + pytest.param('share.repo', '/tmp/share/project', '/tmp/share/user', id='project-override-in-user-config'), ]) @pytest.mark.datafiles(DATA_DIR) -def test_push(cli, tmpdir, datafiles, user_url, project_url, override_url): +def test_push(cli, tmpdir, datafiles, override_url, user_url, project_url): project = str(datafiles) share = create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) @@ -45,9 +45,9 @@ def test_push(cli, tmpdir, datafiles, user_url, project_url, override_url): state = cli.get_element_state(project, 'target.bst') assert state == 'cached' - user_url = share.repo if user_url == 'share.repo' else user_url - project_url = share.repo if project_url == 'share.repo' else project_url override_url = share.repo if override_url == 'share.repo' else override_url + project_url = share.repo if project_url == 'share.repo' else project_url + user_url = share.repo if user_url == 'share.repo' else user_url # Configure artifact share cli.configure({ -- cgit v1.2.1