summaryrefslogtreecommitdiff
path: root/tests/artifactcache
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-06-17 14:12:27 +0100
committerJames Ennis <james.ennis@codethink.com>2019-06-26 08:36:20 +0000
commit1c0bf810c6e5c8e01e9213acafb7079c8ce814a1 (patch)
tree07953d65d5073637c9974a7b710379cc210cc222 /tests/artifactcache
parent956cd6d4485e30a9f39c7a1e44bf9fdc47392e3e (diff)
downloadbuildstream-1c0bf810c6e5c8e01e9213acafb7079c8ce814a1.tar.gz
testutils: Move assert_shared and assert_not_shared to testutils
Diffstat (limited to 'tests/artifactcache')
-rw-r--r--tests/artifactcache/junctions.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py
index f677a2bd6..cb4698659 100644
--- a/tests/artifactcache/junctions.py
+++ b/tests/artifactcache/junctions.py
@@ -8,7 +8,7 @@ import pytest
from buildstream import _yaml
from buildstream.testing import cli # pylint: disable=unused-import
-from tests.testutils import create_artifact_share
+from tests.testutils import create_artifact_share, assert_shared
DATA_DIR = os.path.join(
@@ -17,17 +17,6 @@ DATA_DIR = os.path.join(
)
-# Assert that a given artifact is in the share
-#
-def assert_shared(cli, share, project_name, project, element_name):
- # NOTE: 'test' here is the name of the project
- # specified in the project.conf we are testing with.
- #
- if not share.has_artifact(cli.get_artifact_name(project, project_name, element_name)):
- raise AssertionError("Artifact share at {} does not contain the expected element {}"
- .format(share.repo, element_name))
-
-
def project_set_artifacts(project, url):
project_conf_file = os.path.join(project, 'project.conf')
project_config = _yaml.load(project_conf_file)
@@ -64,8 +53,8 @@ def test_push_pull(cli, tmpdir, datafiles):
assert result.exit_code == 0
# And finally assert that the artifacts are in the right shares
- assert_shared(cli, share, 'parent', project, 'target.bst')
- assert_shared(cli, base_share, 'base', base_project, 'base-element.bst')
+ assert_shared(cli, share, project, 'target.bst', project_name='parent')
+ 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