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

Method TestListOrgPools

runner/organizations_test.go:506–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

504}
505
506func (s *OrgTestSuite) TestListOrgPools() {
507 entity := params.ForgeEntity{
508 ID: s.Fixtures.StoreOrgs["test-org-1"].ID,
509 EntityType: params.ForgeEntityTypeOrganization,
510 }
511 orgPools := []params.Pool{}
512 for i := 1; i <= 2; i++ {
513 s.Fixtures.CreatePoolParams.Image = fmt.Sprintf("test-org-%v", i)
514 pool, err := s.Fixtures.Store.CreateEntityPool(s.Fixtures.AdminContext, entity, s.Fixtures.CreatePoolParams)
515 if err != nil {
516 s.FailNow(fmt.Sprintf("cannot create org pool: %v", err))
517 }
518 orgPools = append(orgPools, pool)
519 }
520
521 pools, err := s.Runner.ListOrgPools(s.Fixtures.AdminContext, s.Fixtures.StoreOrgs["test-org-1"].ID)
522
523 s.Require().Nil(err)
524 garmTesting.EqualDBEntityID(s.T(), orgPools, pools)
525}
526
527func (s *OrgTestSuite) TestListOrgPoolsErrUnauthorized() {
528 _, err := s.Runner.ListOrgPools(context.Background(), "dummy-org-id")

Callers

nothing calls this directly

Calls 2

CreateEntityPoolMethod · 0.65
ListOrgPoolsMethod · 0.65

Tested by

no test coverage detected