()
| 464 | } |
| 465 | |
| 466 | func (c *CacheTestSuite) TestSetEntityScaleSet() { |
| 467 | entity := params.ForgeEntity{ |
| 468 | ID: "test-entity", |
| 469 | EntityType: params.ForgeEntityTypeOrganization, |
| 470 | Name: "test", |
| 471 | Owner: "test", |
| 472 | } |
| 473 | scaleSet := params.ScaleSet{ |
| 474 | OrgID: "test-entity", |
| 475 | ID: 1, |
| 476 | } |
| 477 | |
| 478 | SetEntity(entity) |
| 479 | SetEntityScaleSet(entity.ID, scaleSet) |
| 480 | |
| 481 | cachedEntity, ok := GetEntity(entity.ID) |
| 482 | c.Require().True(ok) |
| 483 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 484 | scaleSets := GetEntityScaleSets(entity.ID) |
| 485 | c.Require().Len(scaleSets, 1) |
| 486 | c.Require().Contains(scaleSets, scaleSet) |
| 487 | c.Require().False(scaleSets[0].Enabled) |
| 488 | |
| 489 | scaleSet.Enabled = true |
| 490 | SetEntityScaleSet(entity.ID, scaleSet) |
| 491 | scaleSets = GetEntityScaleSets(entity.ID) |
| 492 | c.Require().Len(scaleSets, 1) |
| 493 | c.Require().Contains(scaleSets, scaleSet) |
| 494 | c.Require().True(scaleSets[0].Enabled) |
| 495 | } |
| 496 | |
| 497 | func (c *CacheTestSuite) TestDeleteEntityPool() { |
| 498 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected