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

Method TestDeleteEntityScaleSet

cache/cache_test.go:520–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518}
519
520func (c *CacheTestSuite) TestDeleteEntityScaleSet() {
521 entity := params.ForgeEntity{
522 ID: "test-entity",
523 EntityType: params.ForgeEntityTypeOrganization,
524 Name: "test",
525 Owner: "test",
526 }
527 scaleSet := params.ScaleSet{
528 ID: 1,
529 }
530
531 SetEntity(entity)
532 SetEntityScaleSet(entity.ID, scaleSet)
533 cachedEntity, ok := GetEntity(entity.ID)
534 c.Require().True(ok)
535 c.Require().Equal(entity.ID, cachedEntity.ID)
536
537 DeleteEntityScaleSet(entity.ID, scaleSet.ID)
538 scaleSets := GetEntityScaleSets(entity.ID)
539 c.Require().Len(scaleSets, 0)
540 c.Require().NotContains(scaleSets, scaleSet)
541}
542
543func (c *CacheTestSuite) TestFindPoolsMatchingAllTags() {
544 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 6

SetEntityFunction · 0.85
SetEntityScaleSetFunction · 0.85
GetEntityFunction · 0.85
DeleteEntityScaleSetFunction · 0.85
GetEntityScaleSetsFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected