diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-09-09 10:05:11 +0100 |
---|---|---|
committer | James Ennis <james.ennis@codethink.co.uk> | 2019-09-12 16:29:13 +0100 |
commit | c8a06a4515e67e5007fc2f5cb3f83e3a775073c9 (patch) | |
tree | 0273d4edb78f3cb71eed42a025856b17d40148d3 /tests/frontend | |
parent | 6cb668ade39dfe1cf5e23177b022492e1632b035 (diff) | |
download | buildstream-c8a06a4515e67e5007fc2f5cb3f83e3a775073c9.tar.gz |
source_checkout.py: Add test for --tar/--directory conflict
Diffstat (limited to 'tests/frontend')
-rw-r--r-- | tests/frontend/source_checkout.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py index e13adc910..b95251958 100644 --- a/tests/frontend/source_checkout.py +++ b/tests/frontend/source_checkout.py @@ -212,3 +212,20 @@ def test_source_checkout_tar_buildscripts(cli, tmpdir, datafiles): with tarfile.open(tar_file, 'r') as tf: for script in expected_scripts: assert script in tf.getnames() + + +# Test that the --directory and --tar options conflict +@pytest.mark.datafiles(DATA_DIR) +def test_source_checkout_options_tar_and_dir_conflict(cli, tmpdir, datafiles): + project = str(datafiles) + checkout = os.path.join(cli.directory, 'source-checkout') + tar_file = os.path.join(str(tmpdir), 'source-checkout.tar') + target = 'checkout-deps.bst' + + result = cli.run(project=project, args=['source', 'checkout', + '--directory', checkout, + '--tar', tar_file, + target]) + + assert result.exit_code != 0 + assert "ERROR: options --directory and --tar conflict" in result.stderr |