diff options
-rw-r--r-- | tests/frontend/push.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 93b7425b2..1302c4a8c 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -486,3 +486,29 @@ def test_push_no_strict(caplog, cli, tmpdir, datafiles, buildtrees): args += ['artifact', 'push', '--deps', 'all', 'target.bst'] result = cli.run(project=project, args=args) result.assert_success() + + +# Tests that `bst artifact push` fails sensibly when the target was not built. +# +@pytest.mark.datafiles(DATA_DIR) +def test_push_not_built(cli, tmpdir, datafiles): + project = str(datafiles) + + with create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) as share: + # Assert that we are not cached locally + assert cli.get_element_state(project, 'target.bst') == 'waiting' + + # Configure artifact share + cli.configure({ + 'artifacts': { + 'url': share.repo, + 'push': True, + } + }) + + # Now try bst artifact push all the deps + result = cli.run(project=project, args=[ + 'artifact', 'push', 'target.bst', + '--deps', 'all' + ]) + result.assert_success() |