Skip to content

Commit

Permalink
pkg/authconfigmap: silence staticcheck in test
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Apr 20, 2020
1 parent 0dfc830 commit 57e82b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/authconfigmap/authconfigmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,22 +343,22 @@ var _ = Describe("AuthConfigMap{}", func() {
}

It("should add a role and a user", func() {
cm := addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
cm = addAndSave(userA, userAUsername, userAGroups)
_ = addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
cm := addAndSave(userA, userAUsername, userAGroups)
Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoleA))
Expect(cm.Data["mapUsers"]).To(MatchYAML(expectedUserA))
})
It("should append a second role and user", func() {
cm := addAndSave(roleB, RoleNodeGroupUsername, []string{groupB})
cm = addAndSave(userB, userBUsername, userBGroups)
_ = addAndSave(roleB, RoleNodeGroupUsername, []string{groupB})
cm := addAndSave(userB, userBUsername, userBGroups)
Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoleA + expectedRoleB))
Expect(cm.Data["mapUsers"]).To(MatchYAML(expectedUserA + expectedUserB))
})
It("should append a duplicate role", func() {
cm := addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
_ = addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
expectedRoles := expectedRoleA + expectedRoleB + expectedRoleA

cm = addAndSave(userA, userAUsername, userAGroups)
cm := addAndSave(userA, userAUsername, userAGroups)
expectedUsers := expectedUserA + expectedUserB + expectedUserA

Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoles))
Expand Down

0 comments on commit 57e82b5

Please sign in to comment.