[ARVADOS] updated: 4c360c5a3a9564f584dac973810059d2d45d08ef
Git user
git at public.curoverse.com
Mon May 2 14:24:27 EDT 2016
Summary of changes:
sdk/cli/bin/arv | 2 +-
sdk/cli/test/test_arv-collection-create.rb | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
via 4c360c5a3a9564f584dac973810059d2d45d08ef (commit)
from fd57cb09ccf75c49653f8fb66fe6f4c1da49b687 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 4c360c5a3a9564f584dac973810059d2d45d08ef
Author: Tom Clegg <tom at curoverse.com>
Date: Mon May 2 14:22:47 2016 -0400
Read resource object from a file, e.g., arv collection create --collection /tmp/foo.json
No issue #
diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 185a5b0..541bcdc 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -566,7 +566,7 @@ def parse_arguments(discovery_document, subcommands)
end
end
- discovered_params.each do |k,v|
+ discovered_params.merge({resource => {'type' => 'object'}}).each do |k,v|
k = k.to_sym
if ['object', 'array'].index(v["type"]) and method_opts.has_key? k
if method_opts[k].andand.match /^\//
diff --git a/sdk/cli/test/test_arv-collection-create.rb b/sdk/cli/test/test_arv-collection-create.rb
index 3dc4bdd..f7a9dbe 100644
--- a/sdk/cli/test/test_arv-collection-create.rb
+++ b/sdk/cli/test/test_arv-collection-create.rb
@@ -1,6 +1,7 @@
require 'minitest/autorun'
require 'digest/md5'
require 'active_support/core_ext'
+require 'tempfile'
class TestCollectionCreate < Minitest::Test
def setup
@@ -16,7 +17,22 @@ class TestCollectionCreate < Minitest::Test
end
assert /^([0-9a-z]{5}-4zz18-[0-9a-z]{15})?$/.match(out)
assert_equal '', err
- $stderr.puts err
+ end
+
+ def test_read_resource_object_from_file
+ tempfile = Tempfile.new('collection')
+ begin
+ tempfile.write({manifest_text: foo_manifest}.to_json)
+ tempfile.close
+ out, err = capture_subprocess_io do
+ assert_arv('--format', 'uuid',
+ 'collection', 'create', '--collection', tempfile.path)
+ end
+ assert /^([0-9a-z]{5}-4zz18-[0-9a-z]{15})?$/.match(out)
+ assert_equal '', err
+ ensure
+ tempfile.unlink
+ end
end
protected
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list