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

Method TestCreateUser

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

Source from the content-addressed store, hash-verified

131}
132
133func (s *UserTestSuite) TestCreateUser() {
134 // call tested function
135 user, err := s.Store.CreateUser(context.Background(), s.Fixtures.NewUserParams)
136
137 // assertions
138 s.Require().Nil(err)
139 storeUser, err := s.Store.GetUserByID(context.Background(), user.ID)
140 if err != nil {
141 s.FailNow(fmt.Sprintf("failed to get user by id: %v", err))
142 }
143 s.Require().Equal(storeUser.Email, user.Email)
144 s.Require().Equal(storeUser.Username, user.Username)
145 s.Require().Equal(storeUser.FullName, user.FullName)
146}
147
148func (s *UserTestSuite) TestCreateUserMissingUsernameEmail() {
149 // this is already created in `SetupTest()`

Callers

nothing calls this directly

Calls 2

CreateUserMethod · 0.65
GetUserByIDMethod · 0.65

Tested by

no test coverage detected