You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/01/14 07:31:12 UTC
[buildstream] 05/08: tests/frontend/artifact_delete.py: Test
artifact deletion without a project
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch tristan/optional-project
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 6f69887656b2ab5616a94052c680d67cfb026bb5
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Thu Jan 14 16:20:16 2021 +0900
tests/frontend/artifact_delete.py: Test artifact deletion without a project
---
tests/frontend/artifact_delete.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/frontend/artifact_delete.py b/tests/frontend/artifact_delete.py
index 7b26a76..37b9731 100644
--- a/tests/frontend/artifact_delete.py
+++ b/tests/frontend/artifact_delete.py
@@ -50,7 +50,8 @@ def test_artifact_delete_element(cli, tmpdir, datafiles):
# Test that we can delete an artifact by specifying its ref.
@pytest.mark.datafiles(DATA_DIR)
-def test_artifact_delete_artifact(cli, tmpdir, datafiles):
+@pytest.mark.parametrize("with_project", [True, False], ids=["with-project", "without-project"])
+def test_artifact_delete_artifact(cli, tmpdir, datafiles, with_project):
project = str(datafiles)
element = "target.bst"
@@ -69,6 +70,10 @@ def test_artifact_delete_artifact(cli, tmpdir, datafiles):
# Explicitly check that the ARTIFACT exists in the cache
assert os.path.exists(os.path.join(local_cache, "artifacts", "refs", artifact))
+ # Delete the project.conf if we're going to try this without a project
+ if not with_project:
+ os.remove(os.path.join(project, "project.conf"))
+
# Delete the artifact
result = cli.run(project=project, args=["artifact", "delete", artifact])
result.assert_success()