MCPcopy Create free account
hub / github.com/cloudbase/garm / TestHasAdminUser

Method TestHasAdminUser

database/sql/users_test.go:205–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203}
204
205func (s *UserTestSuite) TestHasAdminUser() {
206 // create an admin user
207 s.Fixtures.NewUserParams.IsAdmin = true
208 _, err := s.Store.CreateUser(context.Background(), s.Fixtures.NewUserParams)
209 s.Require().Nil(err)
210
211 // check again if the store has any admin users
212 hasAdmin := s.Store.HasAdminUser(context.Background())
213 s.Require().True(hasAdmin)
214}
215
216func (s *UserTestSuite) TestGetUser() {
217 user, err := s.Store.GetUser(context.Background(), s.Fixtures.Users[0].Username)

Callers

nothing calls this directly

Calls 2

CreateUserMethod · 0.65
HasAdminUserMethod · 0.65

Tested by

no test coverage detected