From 5de6e729142a497ecb6e6dc40e2239cae07cd18d Mon Sep 17 00:00:00 2001 From: Tim Pierce Date: Fri, 31 Jan 2014 17:59:04 -0500 Subject: [PATCH] Fix some arv unit tests. --- sdk/cli/Gemfile.lock | 2 +- sdk/cli/test/test_arv-tag.rb | 10 +++++----- sdk/python/arvados/util.py | 9 ++------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/sdk/cli/Gemfile.lock b/sdk/cli/Gemfile.lock index c3ee0f0906..ab2391a522 100644 --- a/sdk/cli/Gemfile.lock +++ b/sdk/cli/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - arvados-cli (0.1.20140128160501) + arvados-cli (0.1.20140130154213) activesupport (~> 3.2, >= 3.2.13) andand (~> 1.3, >= 1.3.3) curb (~> 0.8) diff --git a/sdk/cli/test/test_arv-tag.rb b/sdk/cli/test/test_arv-tag.rb index c095de5089..0e6aa2b156 100644 --- a/sdk/cli/test/test_arv-tag.rb +++ b/sdk/cli/test/test_arv-tag.rb @@ -21,12 +21,12 @@ class TestArvTag < Minitest::Test def test_single_tag_single_obj # Add a single tag. tag_uuid, err = capture_subprocess_io do - assert arv_tag 'add', 'test_tag1', '--object', 'uuid1' + assert arv_tag '--short', 'add', 'test_tag1', '--object', 'uuid1' end assert_empty err out, err = capture_subprocess_io do - assert arv '-h', 'link', 'show', '--uuid', tag_uuid.rstrip + assert arv 'link', 'show', '--uuid', tag_uuid.rstrip end assert_empty err @@ -35,7 +35,7 @@ class TestArvTag < Minitest::Test # Remove the tag. out, err = capture_subprocess_io do - assert arv_tag '-h', 'remove', 'test_tag1', '--object', 'uuid1' + assert arv_tag 'remove', 'test_tag1', '--object', 'uuid1' end assert_empty err @@ -45,7 +45,7 @@ class TestArvTag < Minitest::Test # Verify that the link no longer exists. out, err = capture_subprocess_io do - assert_equal false, arv('-h', 'link', 'show', '--uuid', links[0]['uuid']) + assert_equal false, arv('link', 'show', '--uuid', links[0]['uuid']) end assert_equal "Error: Path not found\n", err @@ -62,7 +62,7 @@ class TestArvTag < Minitest::Test assert_empty err out, err = capture_subprocess_io do - assert arv '-h', 'link', 'list', '--where', '{"link_class":"tag","name":"test_tag1"}' + assert arv 'link', 'list', '--where', '{"link_class":"tag","name":"test_tag1"}' end assert_empty err diff --git a/sdk/python/arvados/util.py b/sdk/python/arvados/util.py index 9286795e5d..4e0d6f05dc 100644 --- a/sdk/python/arvados/util.py +++ b/sdk/python/arvados/util.py @@ -225,7 +225,7 @@ def collection_extract(collection, path, files=[], decompress=True): files_got += [outname] if os.path.exists(os.path.join(path, stream_name, outname)): continue - util.mkdir_dash_p(os.path.dirname(os.path.join(path, stream_name, outname))) + mkdir_dash_p(os.path.dirname(os.path.join(path, stream_name, outname))) outfile = open(os.path.join(path, stream_name, outname), 'wb') for buf in (f.readall_decompressed() if decompress else f.readall()): @@ -243,12 +243,7 @@ def collection_extract(collection, path, files=[], decompress=True): def mkdir_dash_p(path): if not os.path.exists(path): - util.mkdir_dash_p(os.path.dirname(path)) - try: - os.mkdir(path) - except OSError: - if not os.path.exists(path): - os.mkdir(path) + os.makedirs(path) def stream_extract(stream, path, files=[], decompress=True): """Retrieve a stream from Keep and extract it to a local -- 2.39.5