summaryrefslogtreecommitdiff
path: root/tests/sourcecache
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2019-11-27 10:13:20 +0000
committerBenjamin Schubert <contact@benschubert.me>2020-01-16 14:36:35 +0000
commitc48e89d5da3a7b2b2e72d536aaea9ec182d1e1fd (patch)
tree1af19de25fd77085750a9713aeb96f7460eff548 /tests/sourcecache
parent0d012ee39240a677baa6336bcdf96a5c282d3d85 (diff)
downloadbuildstream-c48e89d5da3a7b2b2e72d536aaea9ec182d1e1fd.tar.gz
element.py: Rename '_source_cached' to '_has_all_sources_in_source_cache'
'_source_cached' is not explicit enough as it doesn't distinguishes between sources in their respective caches and sources in the global sourcecache.
Diffstat (limited to 'tests/sourcecache')
-rw-r--r--tests/sourcecache/fetch.py12
-rw-r--r--tests/sourcecache/push.py4
-rw-r--r--tests/sourcecache/staging.py6
3 files changed, 11 insertions, 11 deletions
diff --git a/tests/sourcecache/fetch.py b/tests/sourcecache/fetch.py
index 4096b56b8..e21f84c89 100644
--- a/tests/sourcecache/fetch.py
+++ b/tests/sourcecache/fetch.py
@@ -83,7 +83,7 @@ def test_source_fetch(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements([element_name])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
assert not share.get_source_proto(source._get_source_name())
@@ -112,7 +112,7 @@ def test_source_fetch(cli, tmpdir, datafiles):
assert "Pulled source" in res.stderr
# check that we have the source in the cas now and it's not fetched
- assert element._source_cached()
+ assert element._has_all_sources_in_source_cache()
assert os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) == []
@@ -129,7 +129,7 @@ def test_fetch_fallback(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements([element_name])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
assert not share.get_source_proto(source._get_source_name())
@@ -145,7 +145,7 @@ def test_fetch_fallback(cli, tmpdir, datafiles):
assert ("SUCCESS Fetching from {}".format(repo.source_config(ref=ref)["url"])) in res.stderr
# Check that the source in both in the source dir and the local CAS
- assert element._source_cached()
+ assert element._has_all_sources_in_source_cache()
@pytest.mark.datafiles(DATA_DIR)
@@ -160,7 +160,7 @@ def test_pull_fail(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements([element_name])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
# remove files and check that it doesn't build
@@ -191,7 +191,7 @@ def test_source_pull_partial_fallback_fetch(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements([element_name])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
assert not share.get_artifact_proto(source._get_source_name())
diff --git a/tests/sourcecache/push.py b/tests/sourcecache/push.py
index 771a94ca1..210bbfcff 100644
--- a/tests/sourcecache/push.py
+++ b/tests/sourcecache/push.py
@@ -84,7 +84,7 @@ def test_source_push_split(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements(["push.bst"])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
# check we don't have it in the current cache
@@ -133,7 +133,7 @@ def test_source_push(cli, tmpdir, datafiles):
project.ensure_fully_loaded()
element = project.load_elements(["push.bst"])[0]
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
source = list(element.sources())[0]
# check we don't have it in the current cache
diff --git a/tests/sourcecache/staging.py b/tests/sourcecache/staging.py
index 994adb32a..dbfc028f2 100644
--- a/tests/sourcecache/staging.py
+++ b/tests/sourcecache/staging.py
@@ -65,7 +65,7 @@ def test_source_staged(tmpdir, cli, datafiles):
# seems to be the only way to get the sources?
element = project.load_elements(["import-bin.bst"])[0]
source = list(element.sources())[0]
- assert element._source_cached()
+ assert element._has_all_sources_in_source_cache()
assert sourcecache.contains(source)
# Extract the file and check it's the same as the one we imported
@@ -99,7 +99,7 @@ def test_source_fetch(tmpdir, cli, datafiles):
element = project.load_elements(["import-dev.bst"])[0]
source = list(element.sources())[0]
- assert element._source_cached()
+ assert element._has_all_sources_in_source_cache()
# check that the directory structures are identical
digest = sourcecache.export(source)._get_digest()
@@ -132,7 +132,7 @@ def test_staged_source_build(tmpdir, datafiles, cli):
element = project.load_elements(["import-dev.bst"])[0]
# check consistency of the source
- assert not element._source_cached()
+ assert not element._has_all_sources_in_source_cache()
res = cli.run(project=project_dir, args=["build", "target.bst"])
res.assert_success()