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

Method TestGetAllScaleSets

cache/cache_test.go:995–1021  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

993}
994
995func (c *CacheTestSuite) TestGetAllScaleSets() {
996 entity := params.ForgeEntity{
997 ID: "test-entity",
998 EntityType: params.ForgeEntityTypeOrganization,
999 Name: "test",
1000 Owner: "test",
1001 }
1002 scaleSet1 := params.ScaleSet{
1003 OrgID: "test-entity",
1004 ID: 1,
1005 }
1006 scaleSet2 := params.ScaleSet{
1007 OrgID: "test-entity",
1008 ID: 2,
1009 }
1010
1011 SetEntity(entity)
1012 SetEntityScaleSet(entity.ID, scaleSet1)
1013 SetEntityScaleSet(entity.ID, scaleSet2)
1014 cachedEntity, ok := GetEntity(entity.ID)
1015 c.Require().True(ok)
1016 c.Require().Equal(entity.ID, cachedEntity.ID)
1017 scaleSets := GetAllScaleSets()
1018 c.Require().Len(scaleSets, 2)
1019 c.Require().Equal(scaleSets[0].ID, scaleSet1.ID)
1020 c.Require().Equal(scaleSets[1].ID, scaleSet2.ID)
1021}
1022
1023func (c *CacheTestSuite) TestGetAllGetAllGithubCredentialsAsMap() {
1024 credentials1 := params.ForgeCredentials{

Callers

nothing calls this directly

Calls 5

SetEntityFunction · 0.85
SetEntityScaleSetFunction · 0.85
GetEntityFunction · 0.85
GetAllScaleSetsFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected