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

Method TestGetEntityScaleSet

cache/cache_test.go:647–668  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

645}
646
647func (c *CacheTestSuite) TestGetEntityScaleSet() {
648 entity := params.ForgeEntity{
649 ID: "test-entity",
650 EntityType: params.ForgeEntityTypeOrganization,
651 Name: "test",
652 Owner: "test",
653 }
654 scaleSet := params.ScaleSet{
655 OrgID: "test-entity",
656 ID: 1,
657 }
658
659 SetEntity(entity)
660 SetEntityScaleSet(entity.ID, scaleSet)
661
662 cachedEntity, ok := GetEntity(entity.ID)
663 c.Require().True(ok)
664 c.Require().Equal(entity.ID, cachedEntity.ID)
665 scaleSets, ok := GetEntityScaleSet(entity.ID, scaleSet.ID)
666 c.Require().True(ok)
667 c.Require().Equal(scaleSet.ID, scaleSets.ID)
668}
669
670func (c *CacheTestSuite) TestGetEntityPool() {
671 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 4

SetEntityFunction · 0.85
SetEntityScaleSetFunction · 0.85
GetEntityFunction · 0.85
GetEntityScaleSetFunction · 0.85

Tested by

no test coverage detected