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

Method TestDeleteEntityPool

cache/cache_test.go:497–518  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

495}
496
497func (c *CacheTestSuite) TestDeleteEntityPool() {
498 entity := params.ForgeEntity{
499 ID: "test-entity",
500 EntityType: params.ForgeEntityTypeOrganization,
501 Name: "test",
502 Owner: "test",
503 }
504 pool := params.Pool{
505 ID: "pool-1",
506 }
507
508 SetEntity(entity)
509 SetEntityPool(entity.ID, pool)
510 cachedEntity, ok := GetEntity(entity.ID)
511 c.Require().True(ok)
512 c.Require().Equal(entity.ID, cachedEntity.ID)
513
514 DeleteEntityPool(entity.ID, pool.ID)
515 pools := GetEntityPools(entity.ID)
516 c.Require().Len(pools, 0)
517 c.Require().NotContains(pools, pool)
518}
519
520func (c *CacheTestSuite) TestDeleteEntityScaleSet() {
521 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 6

SetEntityFunction · 0.85
SetEntityPoolFunction · 0.85
GetEntityFunction · 0.85
DeleteEntityPoolFunction · 0.85
GetEntityPoolsFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected