[ARVADOS] updated: 3e5b4f4602903d00650aa7d57a6934617468dd9f

git at public.curoverse.com git at public.curoverse.com
Wed Mar 19 10:12:14 EDT 2014


Summary of changes:
 .../functional/arvados/v1/users_controller_test.rb |   26 ++++---------------
 1 files changed, 6 insertions(+), 20 deletions(-)

       via  3e5b4f4602903d00650aa7d57a6934617468dd9f (commit)
       via  1b6d98d5000a0c21a5e06a5195cba70d0c2d4dde (commit)
      from  87f67abc3c73634afbaf7ebad1445c1f234dc5d4 (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 3e5b4f4602903d00650aa7d57a6934617468dd9f
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Wed Mar 19 10:11:49 2014 -0400

    remove hard coded uuids from tests

diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb
index c6b0e3d..0eb252d 100644
--- a/services/api/test/functional/arvados/v1/users_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/users_controller_test.rb
@@ -63,9 +63,10 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 
 	test "create user with user, vm and repo as input" do
     authorize_with :admin
+		repo_name = 'test_repo'
 
     post :create, {
-      repo_name: 'test_repo',
+      repo_name: repo_name,
 			vm_uuid: 'no_such_vm',
       user: {
 		    uuid: "is_this_correct",		    
@@ -85,7 +86,7 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 		# since no such vm exists, expect only three new links: oid_login_perm, repo link and link add user to 'All users' group
 		verify_num_links @all_links_at_start, 3
 
-		verify_link_exists_for_type 'Repository', 'permission', 'can_write', 'test_repo', created['uuid'], 'arvados#repository', true
+		verify_link_exists_for_type 'Repository', 'permission', 'can_write', repo_name, created['uuid'], 'arvados#repository', true
 
 		verify_link_exists_for_type 'Group', 'permission', 'can_read', 'All users', created['uuid'], 'arvados#group', true
 	end
@@ -115,9 +116,8 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 		
     authorize_with :admin
 
-		# it would be desirable to use inactive_user['uuid'] instead of hard coding user_param
     post :create, {
-      user_param: 'zzzzz-tpzed-x9kqpd79egh49c7',
+      user_param: inactive_user['uuid'],
       repo_name: 'test_repo',
 			vm_uuid: 'no_such_vm',
       user: {}
@@ -234,7 +234,7 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 
     post :create, {
       repo_name: 'test_repo',
-			vm_uuid: 'zzzzz-2x53u-382brsig8rp3064',
+			vm_uuid: @vm_uuid,
       user: {
 				first_name: "in_create_test_first_name",
 		    last_name: "test_last_name",
@@ -256,7 +256,7 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 		verify_link_exists_for_type 'Group', 'permission', 'can_read', 'All users', created['uuid'], 'arvados#group', true
 
 
-		verify_link_exists_for_type 'VirtualMachine', 'permission', 'can_login', 'zzzzz-2x53u-382brsig8rp3064', created['uuid'], 'arvados#virtualMachine', false
+		verify_link_exists_for_type 'VirtualMachine', 'permission', 'can_login', @vm_uuid, created['uuid'], 'arvados#virtualMachine', false
 	end
 
 	def verify_num_links (original_links, expected_num_additional_links)

commit 1b6d98d5000a0c21a5e06a5195cba70d0c2d4dde
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Wed Mar 19 09:59:24 2014 -0400

    Some more refactoring

diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb
index 1d6d828..c6b0e3d 100644
--- a/services/api/test/functional/arvados/v1/users_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/users_controller_test.rb
@@ -251,12 +251,6 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 		# expect 4 new links: oid_login_perm, repo link, vm link and link add user to 'All users' group. 
 		verify_num_links @all_links_at_start, 4
 
-		link_to_verify = {'link_class' => 'permission',
-	                 		'name' => 'can_login',
-  	               		'tail_uuid' => created['email'],
-  	               		'head_kind' => 'arvados#user'}
-		verify_link_exists link_to_verify
-
 		verify_link_exists_for_type 'Repository', 'permission', 'can_write', 'test_repo', created['uuid'], 'arvados#repository', true
 
 		verify_link_exists_for_type 'Group', 'permission', 'can_read', 'All users', created['uuid'], 'arvados#group', true
@@ -271,14 +265,6 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
 							"Expected #{expected_num_additional_links.inspect} more links"
 	end
 
-	def verify_link_exists (link)
-			links = Link.where(link_class: link['link_class'],
-              				   name: link['name'],
-             					   tail_uuid: link['tail_uuid'],
-				                 head_kind: link['head_kind'])
-			assert links.size > 0, "expected one or more links with the given criteria"
-	end
-
 	def verify_link_exists_for_type(class_name, link_class, link_name, head_uuid, tail_uuid, head_kind, fetch_object)
 		if fetch_object
 			object = Object.const_get(class_name).where(name: head_uuid)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list