()
| 430 | } |
| 431 | |
| 432 | func (c *CacheTestSuite) TestSetEntityPool() { |
| 433 | entity := params.ForgeEntity{ |
| 434 | ID: "test-entity", |
| 435 | EntityType: params.ForgeEntityTypeOrganization, |
| 436 | Name: "test", |
| 437 | Owner: "test", |
| 438 | } |
| 439 | pool := params.Pool{ |
| 440 | OrgID: "test-entity", |
| 441 | ID: "pool-1", |
| 442 | } |
| 443 | |
| 444 | SetEntity(entity) |
| 445 | |
| 446 | SetEntityPool(entity.ID, pool) |
| 447 | cachedEntity, ok := GetEntity(entity.ID) |
| 448 | c.Require().True(ok) |
| 449 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 450 | pools := GetEntityPools(entity.ID) |
| 451 | c.Require().Len(pools, 1) |
| 452 | c.Require().Contains(pools, pool) |
| 453 | c.Require().False(pools[0].Enabled) |
| 454 | |
| 455 | pool.Enabled = true |
| 456 | SetEntityPool(entity.ID, pool) |
| 457 | cachedEntity, ok = GetEntity(entity.ID) |
| 458 | c.Require().True(ok) |
| 459 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 460 | pools = GetEntityPools(entity.ID) |
| 461 | c.Require().Len(pools, 1) |
| 462 | c.Require().Contains(pools, pool) |
| 463 | c.Require().True(pools[0].Enabled) |
| 464 | } |
| 465 | |
| 466 | func (c *CacheTestSuite) TestSetEntityScaleSet() { |
| 467 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected