diff options
Diffstat (limited to 'tests/artifactcache/junctions.py')
-rw-r--r-- | tests/artifactcache/junctions.py | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 91cc01fff..76ba85fb5 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -26,9 +26,7 @@ def test_push_pull(cli, tmpdir, datafiles): project = os.path.join(str(datafiles), "parent") base_project = os.path.join(str(project), "base") - with create_artifact_share( - os.path.join(str(tmpdir), "artifactshare-parent") - ) as share, create_artifact_share( + with create_artifact_share(os.path.join(str(tmpdir), "artifactshare-parent")) as share, create_artifact_share( os.path.join(str(tmpdir), "artifactshare-base") ) as base_share: @@ -46,9 +44,7 @@ def test_push_pull(cli, tmpdir, datafiles): project_set_artifacts(base_project, base_share.repo) # Now try bst artifact push - result = cli.run( - project=project, args=["artifact", "push", "--deps", "all", "target.bst"] - ) + result = cli.run(project=project, args=["artifact", "push", "--deps", "all", "target.bst"]) assert result.exit_code == 0 # And finally assert that the artifacts are in the right shares @@ -56,16 +52,12 @@ def test_push_pull(cli, tmpdir, datafiles): # In the parent project's cache assert_shared(cli, share, project, "target.bst", project_name="parent") assert_shared(cli, share, project, "app.bst", project_name="parent") - assert_not_shared( - cli, share, base_project, "base-element.bst", project_name="base" - ) + assert_not_shared(cli, share, base_project, "base-element.bst", project_name="base") # In the junction project's cache assert_not_shared(cli, base_share, project, "target.bst", project_name="parent") assert_not_shared(cli, base_share, project, "app.bst", project_name="parent") - assert_shared( - cli, base_share, base_project, "base-element.bst", project_name="base" - ) + assert_shared(cli, base_share, base_project, "base-element.bst", project_name="base") # Now we've pushed, delete the user's local artifact cache # directory and try to redownload it from the share @@ -82,9 +74,7 @@ def test_push_pull(cli, tmpdir, datafiles): assert state != "cached" # Now try bst artifact pull - result = cli.run( - project=project, args=["artifact", "pull", "--deps", "all", "target.bst"] - ) + result = cli.run(project=project, args=["artifact", "pull", "--deps", "all", "target.bst"]) assert result.exit_code == 0 # And assert that they are again in the local cache, without having built @@ -107,9 +97,7 @@ def test_caching_junction_elements(cli, tmpdir, datafiles): junction_data["config"] = {"cache-junction-elements": True} _yaml.roundtrip_dump(junction_data, junction_element) - with create_artifact_share( - os.path.join(str(tmpdir), "artifactshare-parent") - ) as share, create_artifact_share( + with create_artifact_share(os.path.join(str(tmpdir), "artifactshare-parent")) as share, create_artifact_share( os.path.join(str(tmpdir), "artifactshare-base") ) as base_share: @@ -127,9 +115,7 @@ def test_caching_junction_elements(cli, tmpdir, datafiles): project_set_artifacts(base_project, base_share.repo) # Now try bst artifact push - result = cli.run( - project=project, args=["artifact", "push", "--deps", "all", "target.bst"] - ) + result = cli.run(project=project, args=["artifact", "push", "--deps", "all", "target.bst"]) assert result.exit_code == 0 # And finally assert that the artifacts are in the right shares @@ -142,9 +128,7 @@ def test_caching_junction_elements(cli, tmpdir, datafiles): # The junction project's cache should only contain elements in the junction project assert_not_shared(cli, base_share, project, "target.bst", project_name="parent") assert_not_shared(cli, base_share, project, "app.bst", project_name="parent") - assert_shared( - cli, base_share, base_project, "base-element.bst", project_name="base" - ) + assert_shared(cli, base_share, base_project, "base-element.bst", project_name="base") @pytest.mark.datafiles(DATA_DIR) @@ -156,9 +140,7 @@ def test_ignore_junction_remotes(cli, tmpdir, datafiles): junction_element = os.path.join(project, "base.bst") junction_data = _yaml.roundtrip_load(junction_element) - with create_artifact_share( - os.path.join(str(tmpdir), "artifactshare-parent") - ) as share, create_artifact_share( + with create_artifact_share(os.path.join(str(tmpdir), "artifactshare-parent")) as share, create_artifact_share( os.path.join(str(tmpdir), "artifactshare-base") ) as base_share: @@ -175,16 +157,12 @@ def test_ignore_junction_remotes(cli, tmpdir, datafiles): # The parent project's cache should only contain project elements assert_shared(cli, share, project, "target.bst", project_name="parent") assert_shared(cli, share, project, "app.bst", project_name="parent") - assert_not_shared( - cli, share, base_project, "base-element.bst", project_name="base" - ) + assert_not_shared(cli, share, base_project, "base-element.bst", project_name="base") # The junction project's cache should only contain elements in the junction project assert_not_shared(cli, base_share, project, "target.bst", project_name="parent") assert_not_shared(cli, base_share, project, "app.bst", project_name="parent") - assert_shared( - cli, base_share, base_project, "base-element.bst", project_name="base" - ) + assert_shared(cli, base_share, base_project, "base-element.bst", project_name="base") # Ensure that, from now on, we ignore junction element remotes junction_data["config"] = {"ignore-junction-remotes": True} @@ -205,9 +183,7 @@ def test_ignore_junction_remotes(cli, tmpdir, datafiles): assert state != "cached" # Now try bst artifact pull - result = cli.run( - project=project, args=["artifact", "pull", "--deps", "all", "target.bst"] - ) + result = cli.run(project=project, args=["artifact", "pull", "--deps", "all", "target.bst"]) assert result.exit_code == 0 # And assert that they are again in the local cache, without having built |