[ARVADOS] updated: a2ef5d0f32746fe06e89737ea5744622fc43e012
git at public.curoverse.com
git at public.curoverse.com
Thu Aug 14 21:48:32 EDT 2014
Summary of changes:
.../arvados/v1/collections_controller_test.rb | 36 +++++++++----------
services/api/test/unit/link_test.rb | 42 ----------------------
2 files changed, 18 insertions(+), 60 deletions(-)
via a2ef5d0f32746fe06e89737ea5744622fc43e012 (commit)
via 7dae5c418a130f07301282cb67f2f991671931db (commit)
from cc6f3141d4e55c8adab282762bad9a8643336346 (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 a2ef5d0f32746fe06e89737ea5744622fc43e012
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Aug 14 21:48:26 2014 -0400
3036: Fixing uuid -> portable_data_hash in collections controller tests.
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index 9592d2a..e6834e0 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -68,7 +68,7 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
./baz acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:bar.txt
EOS
}
- test_collection[:uuid] =
+ test_collection[:portable_data_hash] =
Digest::MD5.hexdigest(test_collection[:manifest_text]) +
'+' +
test_collection[:manifest_text].length.to_s
@@ -105,7 +105,7 @@ EOS
authorize_with :active
test_collection = {
manifest_text: "",
- uuid: "d41d8cd98f00b204e9800998ecf8427e+0"
+ portable_data_hash: "d41d8cd98f00b204e9800998ecf8427e+0"
}
post :create, {
collection: test_collection
@@ -128,7 +128,7 @@ EOS
collection: {
owner_uuid: 'zzzzz-j7d0g-rew6elm53kancon',
manifest_text: manifest_text,
- uuid: "d30fe8ae534397864cb96c544f4cf102"
+ portable_data_hash: "d30fe8ae534397864cb96c544f4cf102"
}
}
assert_response :success
@@ -144,7 +144,7 @@ EOS
collection: {
owner_uuid: 'zzzzz-j7d0g-8ulrifv67tve5sx',
manifest_text: manifest_text,
- uuid: "d30fe8ae534397864cb96c544f4cf102"
+ portable_data_hash: "d30fe8ae534397864cb96c544f4cf102"
}
}
assert_response :success
@@ -160,7 +160,7 @@ EOS
collection: {
owner_uuid: 'zzzzz-j7d0g-it30l961gq3t0oi',
manifest_text: manifest_text,
- uuid: "d30fe8ae534397864cb96c544f4cf102"
+ portable_data_hash: "d30fe8ae534397864cb96c544f4cf102"
}
}
assert_response 403
@@ -174,7 +174,7 @@ EOS
collection: {
owner_uuid: 'zzzzz-j7d0g-it30l961gq3t0oi',
manifest_text: manifest_text,
- uuid: "d30fe8ae534397864cb96c544f4cf102"
+ portable_data_hash: "d30fe8ae534397864cb96c544f4cf102"
}
}
assert_response :success
@@ -187,7 +187,7 @@ EOS
collection: <<-EOS
{
"manifest_text":". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n",\
- "uuid":"d30fe8ae534397864cb96c544f4cf102"\
+ "portable_data_hash":"d30fe8ae534397864cb96c544f4cf102"\
}
EOS
}
@@ -201,7 +201,7 @@ EOS
collection: <<-EOS
{
"manifest_text":". d41d8cd98f00b204e9800998ecf8427e 0:0:bar.txt\n",\
- "uuid":"d30fe8ae534397864cb96c544f4cf102"\
+ "portable_data_hash":"d30fe8ae534397864cb96c544f4cf102"\
}
EOS
}
@@ -214,7 +214,7 @@ EOS
post :create, {
collection: {
manifest_text: ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n",
- uuid: "d30fe8ae534397864cb96c544f4cf102+47+Khint+Xhint+Zhint"
+ portable_data_hash: "d30fe8ae534397864cb96c544f4cf102+47+Khint+Xhint+Zhint"
}
}
assert_response :success
@@ -305,7 +305,7 @@ EOS
post :create, {
collection: {
manifest_text: signed_manifest,
- uuid: manifest_uuid,
+ portable_data_hash: manifest_uuid,
}
}
assert_response :success
@@ -353,7 +353,7 @@ EOS
post :create, {
collection: {
manifest_text: signed_manifest,
- uuid: manifest_uuid,
+ portable_data_hash: manifest_uuid,
}
}
assert_response :success
@@ -393,7 +393,7 @@ EOS
post :create, {
collection: {
manifest_text: bad_manifest,
- uuid: manifest_uuid
+ portable_data_hash: manifest_uuid
}
}
@@ -417,7 +417,7 @@ EOS
post :create, {
collection: {
manifest_text: signed_manifest,
- uuid: manifest_uuid
+ portable_data_hash: manifest_uuid
}
}
@@ -439,7 +439,7 @@ EOS
test_collection = {
manifest_text: manifest_text,
- uuid: manifest_uuid,
+ portable_data_hash: manifest_uuid,
}
post_collection = Marshal.load(Marshal.dump(test_collection))
post :create, {
@@ -448,7 +448,7 @@ EOS
assert_response :success
assert_not_nil assigns(:object)
resp = JSON.parse(@response.body)
- assert_equal manifest_uuid, resp['uuid']
+ assert_equal manifest_uuid, resp['portable_data_hash']
assert_equal 48, resp['data_size']
# The manifest in the response will have had permission hints added.
@@ -481,13 +481,13 @@ EOS
post :create, {
collection: {
manifest_text: signed_manifest,
- uuid: manifest_uuid,
+ portable_data_hash: manifest_uuid,
}
}
assert_response :success
assert_not_nil assigns(:object)
resp = JSON.parse(@response.body)
- assert_equal manifest_uuid, resp['uuid']
+ assert_equal manifest_uuid, resp['portable_data_hash']
assert_equal 48, resp['data_size']
# All of the locators in the output must be signed.
# Each line is of the form "path locator locator ... 0:0:file.txt"
@@ -509,7 +509,7 @@ EOS
post :create, {
collection: {
manifest_text: unsigned_manifest,
- uuid: manifest_uuid,
+ portable_data_hash: manifest_uuid,
}
}
assert_response 403,
commit 7dae5c418a130f07301282cb67f2f991671931db
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Aug 14 21:47:48 2014 -0400
3036: Remove obsolete 'name' link tests.
diff --git a/services/api/test/unit/link_test.rb b/services/api/test/unit/link_test.rb
index 640b26c..ff7e8ea 100644
--- a/services/api/test/unit/link_test.rb
+++ b/services/api/test/unit/link_test.rb
@@ -7,48 +7,6 @@ class LinkTest < ActiveSupport::TestCase
set_user_from_auth :admin_trustedclient
end
- test 'name links with the same tail_uuid must be unique' do
- a = Link.create!(tail_uuid: groups(:aproject).uuid,
- head_uuid: specimens(:owned_by_active_user).uuid,
- link_class: 'name',
- name: 'foo')
- assert a.valid?, a.errors.to_s
- assert_equal groups(:aproject).uuid, a.owner_uuid
- assert_raises ActiveRecord::RecordNotUnique do
- b = Link.create!(tail_uuid: groups(:aproject).uuid,
- head_uuid: specimens(:owned_by_active_user).uuid,
- link_class: 'name',
- name: 'foo')
- end
- end
-
- test 'name links with different tail_uuid need not be unique' do
- a = Link.create!(tail_uuid: groups(:aproject).uuid,
- head_uuid: specimens(:owned_by_active_user).uuid,
- link_class: 'name',
- name: 'foo')
- assert a.valid?, a.errors.to_s
- assert_equal groups(:aproject).uuid, a.owner_uuid
- b = Link.create!(tail_uuid: groups(:asubproject).uuid,
- head_uuid: specimens(:owned_by_active_user).uuid,
- link_class: 'name',
- name: 'foo')
- assert b.valid?, b.errors.to_s
- assert_equal groups(:asubproject).uuid, b.owner_uuid
- assert_not_equal(a.uuid, b.uuid,
- "created two links and got the same uuid back.")
- end
-
- [nil, '', false].each do |name|
- test "name links cannot have name=#{name.inspect}" do
- a = Link.create(tail_uuid: groups(:aproject).uuid,
- head_uuid: specimens(:owned_by_active_user).uuid,
- link_class: 'name',
- name: name)
- assert a.invalid?, "invalid name was accepted as valid?"
- end
- end
-
test "cannot delete an object referenced by links" do
ob = Specimen.create
link = Link.create(tail_uuid: users(:active).uuid,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list