[ARVADOS] updated: 8370640cef5110b65ba6c3a2bf9d7f56541b4c7f
git at public.curoverse.com
git at public.curoverse.com
Mon May 5 16:06:13 EDT 2014
Summary of changes:
.../test/unit/arvados_resource_list_test.rb | 34 ++++++++++++++++++++
services/api/app/models/arvados_model.rb | 2 +-
services/api/test/unit/group_test.rb | 5 ++-
3 files changed, 38 insertions(+), 3 deletions(-)
via 8370640cef5110b65ba6c3a2bf9d7f56541b4c7f (commit)
via e76d4b556f07bbeab0998ca0332dad187bb119ee (commit)
via 5af51b564ca9d805f8e61b4bb3c37ed813b3bd16 (commit)
from 546687a7c95109a57efdf7cecbc3f795bc3e72f1 (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 8370640cef5110b65ba6c3a2bf9d7f56541b4c7f
Author: Tom Clegg <tom at curoverse.com>
Date: Mon May 5 16:05:22 2014 -0400
Raise PermissionDeniedError more consistently
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index e495f9f..875f1c0 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -176,7 +176,7 @@ class ArvadosModel < ActiveRecord::Base
# current_user is, or has :write permission on, the new owner
else
logger.warn "User #{current_user.uuid} tried to change owner_uuid of #{self.class.to_s} #{self.uuid} to #{self.owner_uuid} but does not have permission to write to #{self.owner_uuid}"
- return false
+ raise PermissionDeniedError
end
end
if new_record?
commit e76d4b556f07bbeab0998ca0332dad187bb119ee
Author: Tom Clegg <tom at curoverse.com>
Date: Mon May 5 16:02:29 2014 -0400
Comment mysterious testing code.
diff --git a/services/api/test/unit/group_test.rb b/services/api/test/unit/group_test.rb
index 6b419ad..597af62 100644
--- a/services/api/test/unit/group_test.rb
+++ b/services/api/test/unit/group_test.rb
@@ -5,9 +5,10 @@ class GroupTest < ActiveSupport::TestCase
test "cannot set owner_uuid to object with existing ownership cycle" do
set_user_from_auth :active_trustedclient
- # First make sure we have lots of permission on the bad group
+ # First make sure we have lots of permission on the bad group by
+ # renaming it to "{current name} is mine all mine"
g = groups(:bad_group_has_ownership_cycle_b)
- g.name += " xyz"
+ g.name += " is mine all mine"
assert g.save, "active user should be able to modify group #{g.uuid}"
# Use the group as the owner of a new object
commit 5af51b564ca9d805f8e61b4bb3c37ed813b3bd16
Author: Tom Clegg <tom at curoverse.com>
Date: Mon May 5 15:59:44 2014 -0400
Add test for links_for + multiple link_classes.
diff --git a/apps/workbench/test/unit/arvados_resource_list_test.rb b/apps/workbench/test/unit/arvados_resource_list_test.rb
index 4ce6741..24bb0fe 100644
--- a/apps/workbench/test/unit/arvados_resource_list_test.rb
+++ b/apps/workbench/test/unit/arvados_resource_list_test.rb
@@ -17,4 +17,38 @@ class ResourceListTest < ActiveSupport::TestCase
assert_equal true, results.links_for(api_fixture('jobs')['running']['uuid'], 'name').any?
end
+ test 'links_for returns all link classes (simulated results)' do
+ folder_uuid = api_fixture('groups')['afolder']['uuid']
+ specimen_uuid = api_fixture('specimens')['in_afolder']['uuid']
+ api_response = {
+ kind: 'arvados#specimenList',
+ links: [{kind: 'arvados#link',
+ uuid: 'zzzzz-o0j2j-asdfasdfasdfas0',
+ tail_uuid: folder_uuid,
+ head_uuid: specimen_uuid,
+ link_class: 'name',
+ name: 'Alice'},
+ {kind: 'arvados#link',
+ uuid: 'zzzzz-o0j2j-asdfasdfasdfas1',
+ tail_uuid: folder_uuid,
+ head_uuid: specimen_uuid,
+ link_class: 'foo',
+ name: 'Bob'},
+ {kind: 'arvados#link',
+ uuid: 'zzzzz-o0j2j-asdfasdfasdfas2',
+ tail_uuid: folder_uuid,
+ head_uuid: specimen_uuid,
+ link_class: nil,
+ name: 'Clydesdale'}],
+ items: [{kind: 'arvados#specimen',
+ uuid: specimen_uuid}]
+ }
+ results = ArvadosApiClient.new.unpack_api_response(api_response)
+ assert_equal(['name', 'foo', nil],
+ (results.
+ links_for(specimen_uuid).
+ collect { |x| x.link_class }),
+ "Expected links_for to return all link_classes")
+ end
+
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list