mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
9789543f8f
* add mock package and use in invite tests * mock expired invite test
22 lines
451 B
Go
22 lines
451 B
Go
package mock
|
|
|
|
import "github.com/kolide/kolide-ose/server/kolide"
|
|
|
|
func UserByEmailWithUser(u *kolide.User) UserByEmailFunc {
|
|
return func(email string) (*kolide.User, error) {
|
|
return u, nil
|
|
}
|
|
}
|
|
|
|
func UserWithEmailNotFound() UserByEmailFunc {
|
|
return func(email string) (*kolide.User, error) {
|
|
return nil, &Error{"not found"}
|
|
}
|
|
}
|
|
|
|
func UserWithID(u *kolide.User) UserByIDFunc {
|
|
return func(id uint) (*kolide.User, error) {
|
|
return u, nil
|
|
}
|
|
}
|