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

Method TestGetPoolByIDWithMultiplePools

cache/cache_test.go:1166–1197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1164}
1165
1166func (c *CacheTestSuite) TestGetPoolByIDWithMultiplePools() {
1167 entity := params.ForgeEntity{
1168 ID: "test-entity",
1169 EntityType: params.ForgeEntityTypeOrganization,
1170 Name: "test",
1171 Owner: "test",
1172 }
1173 pool1 := params.Pool{
1174 ID: "pool-1",
1175 Enabled: true,
1176 OrgID: "test-entity",
1177 }
1178 pool2 := params.Pool{
1179 ID: "pool-2",
1180 Enabled: false,
1181 OrgID: "test-entity",
1182 }
1183
1184 SetEntity(entity)
1185 SetEntityPool(entity.ID, pool1)
1186 SetEntityPool(entity.ID, pool2)
1187
1188 retrievedPool1, ok := GetPoolByID("pool-1")
1189 c.Require().True(ok)
1190 c.Require().Equal("pool-1", retrievedPool1.ID)
1191 c.Require().True(retrievedPool1.Enabled)
1192
1193 retrievedPool2, ok := GetPoolByID("pool-2")
1194 c.Require().True(ok)
1195 c.Require().Equal("pool-2", retrievedPool2.ID)
1196 c.Require().False(retrievedPool2.Enabled)
1197}
1198
1199func (c *CacheTestSuite) TestGetScaleSetByIDWithMultipleScaleSets() {
1200 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 3

SetEntityFunction · 0.85
SetEntityPoolFunction · 0.85
GetPoolByIDFunction · 0.85

Tested by

no test coverage detected