Skip to content

Commit

Permalink
Merge pull request #3 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 0.0.3
  • Loading branch information
andyone authored Oct 28, 2024
2 parents ff15f4e + cbd1be0 commit fd9609e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pachca.go
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,19 @@ func (u Users) Active() Users {
return result
}

// Suspended returns slice with inactive users
func (u Users) Suspended() Users {
var result Users

for _, uu := range u {
if uu.IsSuspended {
result = append(result, uu)
}
}

return result
}

// Invited returns all invited users
func (u Users) Invited() Users {
var result Users
Expand Down
1 change: 1 addition & 0 deletions pachca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ func (s *PachcaSuite) TestUsersHelpers(c *C) {
}

c.Assert(uu.Active(), HasLen, 4)
c.Assert(uu.Suspended(), HasLen, 1)

c.Assert(uu.Invited(), HasLen, 1)
c.Assert(uu.Invited()[0].ID, Equals, ID(1))
Expand Down

0 comments on commit fd9609e

Please sign in to comment.