fleet/server/mock/datastore_users_helpers.go
Victor Vrantchan 9789543f8f add mock package and use in invite tests (#603)
* add mock package and use in invite tests

* mock expired invite test
2017-01-10 16:49:14 -05:00

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
}
}