From 395be192b8653c3d912aaae61d57c886dcb7c5b7 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 25 Apr 2024 18:54:59 -0500 Subject: [PATCH] fix unit test Signed-off-by: marcolan018 --- cmd/attach/policy/cmd_test.go | 4 ++-- cmd/detach/policy/cmd_test.go | 4 ++-- pkg/policy/policy_service_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/attach/policy/cmd_test.go b/cmd/attach/policy/cmd_test.go index 83471a435..957c0ec72 100644 --- a/cmd/attach/policy/cmd_test.go +++ b/cmd/attach/policy/cmd_test.go @@ -126,7 +126,7 @@ var _ = Describe("rosa attach policy", func() { err := runner(context.Background(), t.RosaRuntime, c, nil) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(fmt.Sprintf( - "Failed to find the role %s: %s", roleName, roleNotFoundMsg))) + "Failed to find the role '%s': %s", roleName, roleNotFoundMsg))) }) It("Returns an error if the role does not has tag 'red-hat-managed'", func() { @@ -144,7 +144,7 @@ var _ = Describe("rosa attach policy", func() { err := runner(context.Background(), t.RosaRuntime, c, nil) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(fmt.Sprintf( - "Failed to find the policy %s: %s", policyArn1, policyNotFoundMsg))) + "Failed to find the policy '%s': %s", policyArn1, policyNotFoundMsg))) }) It("Returns an error if exceeds policy quota per role", func() { diff --git a/cmd/detach/policy/cmd_test.go b/cmd/detach/policy/cmd_test.go index 448d9b27d..8c2a46ec2 100644 --- a/cmd/detach/policy/cmd_test.go +++ b/cmd/detach/policy/cmd_test.go @@ -115,7 +115,7 @@ var _ = Describe("rosa detach policy", func() { err := runner(context.Background(), t.RosaRuntime, c, nil) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(fmt.Sprintf( - "Failed to find the role %s: %s", roleName, roleNotFoundMsg))) + "Failed to find the role '%s': %s", roleName, roleNotFoundMsg))) }) It("Returns an error if the role does not has tag 'red-hat-managed'", func() { @@ -133,7 +133,7 @@ var _ = Describe("rosa detach policy", func() { err := runner(context.Background(), t.RosaRuntime, c, nil) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(fmt.Sprintf( - "Failed to find the policy %s: %s", policyArn1, policyNotFoundMsg))) + "Failed to find the policy '%s': %s", policyArn1, policyNotFoundMsg))) }) It("Detach policy from role", func() { diff --git a/pkg/policy/policy_service_test.go b/pkg/policy/policy_service_test.go index a5e466b17..76844ae5c 100644 --- a/pkg/policy/policy_service_test.go +++ b/pkg/policy/policy_service_test.go @@ -134,7 +134,7 @@ var _ = Describe("Policy Service", func() { "sample-account-id", "sample-org-id") Expect(err).ShouldNot(HaveOccurred()) Expect(output).To(Equal(fmt.Sprintf("Detached policy '%s' from role '%s'\n"+ - "Currently policy %s is not attached to role %s\n", + "The policy '%s' is currently not attached to role '%s'\n", policyArn1, roleName, policyArn2, roleName))) }) It("Test ManualDetachArbitraryPolicy", func() {