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

Method TestListOrgInstances

database/sql/organizations_test.go:900–921  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

898}
899
900func (s *OrgTestSuite) TestListOrgInstances() {
901 entity, err := s.Fixtures.Orgs[0].GetEntity()
902 s.Require().Nil(err)
903 pool, err := s.Store.CreateEntityPool(s.adminCtx, entity, s.Fixtures.CreatePoolParams)
904 if err != nil {
905 s.FailNow(fmt.Sprintf("cannot create org pool: %v", err))
906 }
907 poolInstances := []params.Instance{}
908 for i := 1; i <= 3; i++ {
909 s.Fixtures.CreateInstanceParams.Name = fmt.Sprintf("test-org-%v", i)
910 instance, err := s.Store.CreateInstance(s.adminCtx, pool.ID, s.Fixtures.CreateInstanceParams)
911 if err != nil {
912 s.FailNow(fmt.Sprintf("cannot create instance: %s", err))
913 }
914 poolInstances = append(poolInstances, instance)
915 }
916
917 instances, err := s.Store.ListEntityInstances(s.adminCtx, entity)
918
919 s.Require().Nil(err)
920 s.equalInstancesByName(poolInstances, instances)
921}
922
923func (s *OrgTestSuite) TestListOrgInstancesInvalidOrgID() {
924 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 5

equalInstancesByNameMethod · 0.95
GetEntityMethod · 0.65
CreateEntityPoolMethod · 0.65
CreateInstanceMethod · 0.65
ListEntityInstancesMethod · 0.65

Tested by

no test coverage detected