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

Method TestCreateOrgPool

runner/organizations_test.go:408–424  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406}
407
408func (s *OrgTestSuite) TestCreateOrgPool() {
409 pool, err := s.Runner.CreateOrgPool(s.Fixtures.AdminContext, s.Fixtures.StoreOrgs["test-org-1"].ID, s.Fixtures.CreatePoolParams)
410
411 s.Fixtures.PoolMgrMock.AssertExpectations(s.T())
412 s.Fixtures.PoolMgrCtrlMock.AssertExpectations(s.T())
413 s.Require().Nil(err)
414
415 org, err := s.Fixtures.Store.GetOrganizationByID(s.Fixtures.AdminContext, s.Fixtures.StoreOrgs["test-org-1"].ID)
416 if err != nil {
417 s.FailNow(fmt.Sprintf("cannot get org by ID: %v", err))
418 }
419 s.Require().Equal(1, len(org.Pools))
420 s.Require().Equal(pool.ID, org.Pools[0].ID)
421 s.Require().Equal(s.Fixtures.CreatePoolParams.ProviderName, org.Pools[0].ProviderName)
422 s.Require().Equal(s.Fixtures.CreatePoolParams.MaxRunners, org.Pools[0].MaxRunners)
423 s.Require().Equal(s.Fixtures.CreatePoolParams.MinIdleRunners, org.Pools[0].MinIdleRunners)
424}
425
426func (s *OrgTestSuite) TestCreateOrgPoolErrUnauthorized() {
427 _, err := s.Runner.CreateOrgPool(context.Background(), "dummy-org-id", s.Fixtures.CreatePoolParams)

Callers

nothing calls this directly

Calls 2

CreateOrgPoolMethod · 0.65
GetOrganizationByIDMethod · 0.65

Tested by

no test coverage detected