summaryrefslogtreecommitdiff
path: root/tests/sourcecache
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-09-06 17:53:54 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-09-12 16:29:12 +0100
commit6cb668ade39dfe1cf5e23177b022492e1632b035 (patch)
treee134aed8352e144bcac85b35376c94796b01037c /tests/sourcecache
parent11e9934df6ec8dcdf2abde074e27450f51522bfd (diff)
downloadbuildstream-6cb668ade39dfe1cf5e23177b022492e1632b035.tar.gz
cli.py: Make source checkout more consistent with artifact checkout
This MR changes the behaviour of source checkout so that it is more like artifact checkout. That is, a --directory option can be provided, rather than a mandatory LOCATION. In addition to this, the --tar option is no longer a boolean flag, rather it expects a tarfile name (just like artifact checkout) The appropriate tests have also been altered so that they support the new API
Diffstat (limited to 'tests/sourcecache')
-rw-r--r--tests/sourcecache/source-checkout.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sourcecache/source-checkout.py b/tests/sourcecache/source-checkout.py
index c2c7fe3cd..4e3391c12 100644
--- a/tests/sourcecache/source-checkout.py
+++ b/tests/sourcecache/source-checkout.py
@@ -49,7 +49,7 @@ def test_source_checkout(tmpdir, datafiles, cli):
repo = create_element_size('target.bst', project_dir, element_path, [], 100000)
# check implicit fetching
- res = cli.run(project=project_dir, args=['source', 'checkout', 'target.bst', target_dir])
+ res = cli.run(project=project_dir, args=['source', 'checkout', '--directory', target_dir, 'target.bst'])
res.assert_success()
assert "Fetching from" in res.stderr
@@ -60,7 +60,7 @@ def test_source_checkout(tmpdir, datafiles, cli):
shutil.rmtree(source_dir)
res = cli.run(project=project_dir,
- args=['source', 'checkout', 'target.bst', target_dir])
+ args=['source', 'checkout', '--directory', target_dir, 'target.bst'])
res.assert_success()
assert "Fetching from" not in res.stderr
@@ -69,5 +69,5 @@ def test_source_checkout(tmpdir, datafiles, cli):
shutil.rmtree(os.path.join(cache_dir, 'cas'))
res = cli.run(project=project_dir,
- args=['source', 'checkout', 'target.bst', target_dir])
+ args=['source', 'checkout', '--directory', target_dir, 'target.bst'])
res.assert_task_error(ErrorDomain.PLUGIN, None)