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

Method TestGetScaleSetByID

cache/cache_test.go:1140–1164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1138}
1139
1140func (c *CacheTestSuite) TestGetScaleSetByID() {
1141 entity := params.ForgeEntity{
1142 ID: "test-entity",
1143 EntityType: params.ForgeEntityTypeOrganization,
1144 Name: "test",
1145 Owner: "test",
1146 }
1147 scaleSet := params.ScaleSet{
1148 ID: 1,
1149 OrgID: "test-entity",
1150 Enabled: true,
1151 }
1152
1153 SetEntity(entity)
1154 SetEntityScaleSet(entity.ID, scaleSet)
1155
1156 retrievedScaleSet, ok := GetScaleSetByID(scaleSet.ID)
1157 c.Require().True(ok)
1158 c.Require().Equal(scaleSet.ID, retrievedScaleSet.ID)
1159 c.Require().Equal(scaleSet.Enabled, retrievedScaleSet.Enabled)
1160
1161 nonExistentScaleSet, ok := GetScaleSetByID(999)
1162 c.Require().False(ok)
1163 c.Require().Equal(params.ScaleSet{}, nonExistentScaleSet)
1164}
1165
1166func (c *CacheTestSuite) TestGetPoolByIDWithMultiplePools() {
1167 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 3

SetEntityFunction · 0.85
SetEntityScaleSetFunction · 0.85
GetScaleSetByIDFunction · 0.85

Tested by

no test coverage detected