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

Method TestCreateOrganization

runner/organizations_test.go:163–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161}
162
163func (s *OrgTestSuite) TestCreateOrganization() {
164 // setup mocks expectations
165 s.Fixtures.PoolMgrMock.On("Start").Return(nil)
166 s.Fixtures.PoolMgrCtrlMock.On("CreateOrgPoolManager", s.Fixtures.AdminContext, mock.AnythingOfType("params.Organization"), s.Fixtures.Providers, s.Fixtures.Store).Return(s.Fixtures.PoolMgrMock, nil)
167
168 // call tested function
169 org, err := s.Runner.CreateOrganization(s.Fixtures.AdminContext, s.Fixtures.CreateOrgParams)
170
171 // assertions
172 s.Fixtures.PoolMgrMock.AssertExpectations(s.T())
173 s.Fixtures.PoolMgrCtrlMock.AssertExpectations(s.T())
174 s.Require().Nil(err)
175 s.Require().Equal(s.Fixtures.CreateOrgParams.Name, org.Name)
176 s.Require().Equal(s.Fixtures.Credentials[s.Fixtures.CreateOrgParams.CredentialsName].Name, org.Credentials.Name)
177 s.Require().Equal(params.PoolBalancerTypeRoundRobin, org.PoolBalancerType)
178}
179
180func (s *OrgTestSuite) TestCreateOrganizationPoolBalancerTypePack() {
181 s.Fixtures.CreateOrgParams.PoolBalancerType = params.PoolBalancerTypePack

Callers

nothing calls this directly

Calls 2

CreateOrganizationMethod · 0.65
ReturnMethod · 0.45

Tested by

no test coverage detected