Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: marcolan018 <llan@redhat.com>
  • Loading branch information
marcolan018 committed Apr 25, 2024
1 parent 546aee3 commit 395be19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/attach/policy/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/detach/policy/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/policy/policy_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 395be19

Please sign in to comment.