diff options
Diffstat (limited to 'tests/sourcecache/fetch.py')
-rw-r--r-- | tests/sourcecache/fetch.py | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/tests/sourcecache/fetch.py b/tests/sourcecache/fetch.py index bc3f32e66..0c347ebbf 100644 --- a/tests/sourcecache/fetch.py +++ b/tests/sourcecache/fetch.py @@ -92,9 +92,7 @@ def test_source_fetch(cli, tmpdir, datafiles): res = cli.run(project=project_dir, args=["build", element_name]) res.assert_success() - assert ( - os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) != [] - ) + assert os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) != [] # get root digest of source sourcecache = context.sourcecache @@ -115,9 +113,7 @@ def test_source_fetch(cli, tmpdir, datafiles): # check that we have the source in the cas now and it's not fetched assert element._source_cached() - assert ( - os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) == [] - ) + assert os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) == [] @pytest.mark.datafiles(DATA_DIR) @@ -145,13 +141,9 @@ def test_fetch_fallback(cli, tmpdir, datafiles): res.assert_success() brief_key = source._get_brief_display_key() assert ( - "Remote source service ({}) does not have source {} cached".format( - share.repo, brief_key - ) - ) in res.stderr - assert ( - "SUCCESS Fetching from {}".format(repo.source_config(ref=ref)["url"]) + "Remote source service ({}) does not have source {} cached".format(share.repo, brief_key) ) in res.stderr + 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() @@ -210,9 +202,7 @@ def test_source_pull_partial_fallback_fetch(cli, tmpdir, datafiles): res = cli.run(project=project_dir, args=["build", element_name]) res.assert_success() - assert ( - os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) != [] - ) + assert os.listdir(os.path.join(str(tmpdir), "cache", "sources", "git")) != [] # get root digest of source sourcecache = context.sourcecache @@ -221,9 +211,7 @@ def test_source_pull_partial_fallback_fetch(cli, tmpdir, datafiles): move_local_cas_to_remote_source_share(str(cache_dir), share.directory) # Remove the cas content, only keep the proto and such around - shutil.rmtree( - os.path.join(str(tmpdir), "sourceshare", "repo", "cas", "objects") - ) + shutil.rmtree(os.path.join(str(tmpdir), "sourceshare", "repo", "cas", "objects")) # check the share doesn't have the object assert not share.has_object(digest) @@ -234,6 +222,4 @@ def test_source_pull_partial_fallback_fetch(cli, tmpdir, datafiles): res = cli.run(project=project_dir, args=["source", "fetch", element_name]) res.assert_success() - assert ( - "SUCCESS Fetching from {}".format(repo.source_config(ref=ref)["url"]) - ) in res.stderr + assert ("SUCCESS Fetching from {}".format(repo.source_config(ref=ref)["url"])) in res.stderr |