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

Method TestDeleteEntity

cache/cache_test.go:414–430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412}
413
414func (c *CacheTestSuite) TestDeleteEntity() {
415 entity := params.ForgeEntity{
416 ID: "test-entity",
417 EntityType: params.ForgeEntityTypeOrganization,
418 Name: "test",
419 Owner: "test",
420 }
421 SetEntity(entity)
422 cachedEntity, ok := GetEntity(entity.ID)
423 c.Require().True(ok)
424 c.Require().Equal(entity.ID, cachedEntity.ID)
425
426 DeleteEntity(entity.ID)
427 cachedEntity, ok = GetEntity(entity.ID)
428 c.Require().False(ok)
429 c.Require().Equal(params.ForgeEntity{}, cachedEntity)
430}
431
432func (c *CacheTestSuite) TestSetEntityPool() {
433 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 3

SetEntityFunction · 0.85
GetEntityFunction · 0.85
DeleteEntityFunction · 0.85

Tested by

no test coverage detected