From fc2145dbbc5557f60d6655729d294281a1caaace Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Wed, 15 Nov 2017 17:14:31 -0500 Subject: [PATCH] move pkg/cmd/admin/policy/modify_roles_test.go -> pkg/oc/admin/policy/modify_roles_test.go --- pkg/{cmd => oc}/admin/policy/modify_roles_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename pkg/{cmd => oc}/admin/policy/modify_roles_test.go (92%) diff --git a/pkg/cmd/admin/policy/modify_roles_test.go b/pkg/oc/admin/policy/modify_roles_test.go similarity index 92% rename from pkg/cmd/admin/policy/modify_roles_test.go rename to pkg/oc/admin/policy/modify_roles_test.go index 0c53ea2be929..d0fd7817f136 100644 --- a/pkg/cmd/admin/policy/modify_roles_test.go +++ b/pkg/oc/admin/policy/modify_roles_test.go @@ -9,7 +9,6 @@ import ( authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization" fakeauthorizationclient "github.com/openshift/origin/pkg/authorization/generated/internalclientset/fake" - "github.com/openshift/origin/pkg/oc/admin/policy" ) func TestModifyNamedClusterRoleBinding(t *testing.T) { @@ -126,11 +125,11 @@ func TestModifyNamedClusterRoleBinding(t *testing.T) { } for tcName, tc := range tests { // Set up modifier options and run AddRole() - o := &policy.RoleModificationOptions{ + o := &RoleModificationOptions{ RoleName: tc.inputRole, RoleBindingName: tc.inputRoleBindingName, Users: tc.inputSubjects, - RoleBindingAccessor: policy.NewClusterRoleBindingAccessor(fakeauthorizationclient.NewSimpleClientset(tc.existingClusterRoleBindings).Authorization()), + RoleBindingAccessor: NewClusterRoleBindingAccessor(fakeauthorizationclient.NewSimpleClientset(tc.existingClusterRoleBindings).Authorization()), } addRoleAndCheck(t, o, tcName, tc.expectedRoleBindingName, tc.expectedSubjects) @@ -259,19 +258,19 @@ func TestModifyNamedLocalRoleBinding(t *testing.T) { } for tcName, tc := range tests { // Set up modifier options and run AddRole() - o := &policy.RoleModificationOptions{ + o := &RoleModificationOptions{ RoleName: tc.inputRole, RoleBindingName: tc.inputRoleBindingName, Users: tc.inputSubjects, RoleNamespace: metav1.NamespaceDefault, - RoleBindingAccessor: policy.NewLocalRoleBindingAccessor(metav1.NamespaceDefault, fakeauthorizationclient.NewSimpleClientset(tc.existingRoleBindings).Authorization()), + RoleBindingAccessor: NewLocalRoleBindingAccessor(metav1.NamespaceDefault, fakeauthorizationclient.NewSimpleClientset(tc.existingRoleBindings).Authorization()), } addRoleAndCheck(t, o, tcName, tc.expectedRoleBindingName, tc.expectedSubjects) } } -func addRoleAndCheck(t *testing.T, o *policy.RoleModificationOptions, tcName, expectedName string, expectedSubjects []string) { +func addRoleAndCheck(t *testing.T, o *RoleModificationOptions, tcName, expectedName string, expectedSubjects []string) { err := o.AddRole() if err != nil { t.Errorf("%s: unexpected err %v", tcName, err)