diff options
author | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-07-30 13:36:15 +0100 |
---|---|---|
committer | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-08-01 16:16:33 +0100 |
commit | 00ddcbd765b25681452039d87b3928c4d61d99a3 (patch) | |
tree | 9b2bd6d9c7cae963bb7303b797ded5785d2e83da /tests/frontend/buildcheckout.py | |
parent | 62a250fefa33f9dcfdc54b09ab4ec4d276fa7891 (diff) | |
download | buildstream-00ddcbd765b25681452039d87b3928c4d61d99a3.tar.gz |
element.py: Raise an exception on unbuilt element checkout
Trying to checkout an element that has no cached artifacts should be and
handled failure. See BuildStream/buildstream#447.
Diffstat (limited to 'tests/frontend/buildcheckout.py')
-rw-r--r-- | tests/frontend/buildcheckout.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 1ec8f491f..f27005ada 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -97,6 +97,16 @@ def test_build_checkout_deps(datafiles, cli, deps): @pytest.mark.datafiles(DATA_DIR) +def test_build_checkout_unbuilt(datafiles, cli): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + # Check that checking out an unbuilt element fails nicely + result = cli.run(project=project, args=['checkout', 'target.bst', checkout]) + result.assert_main_error(ErrorDomain.STREAM, "uncached-checkout-attempt") + + +@pytest.mark.datafiles(DATA_DIR) def test_build_checkout_tarball(datafiles, cli): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout.tar') |