()
| 601 | } |
| 602 | |
| 603 | func (c *CacheTestSuite) TestGetEntityPools() { |
| 604 | entity := params.ForgeEntity{ |
| 605 | ID: "test-entity", |
| 606 | EntityType: params.ForgeEntityTypeOrganization, |
| 607 | Name: "test", |
| 608 | Owner: "test", |
| 609 | } |
| 610 | pool1 := params.Pool{ |
| 611 | ID: "pool-1", |
| 612 | OrgID: "test-entity", |
| 613 | Tags: []params.Tag{ |
| 614 | { |
| 615 | Name: "tag1", |
| 616 | }, |
| 617 | { |
| 618 | Name: "tag2", |
| 619 | }, |
| 620 | }, |
| 621 | } |
| 622 | pool2 := params.Pool{ |
| 623 | ID: "pool-2", |
| 624 | OrgID: "test-entity", |
| 625 | Tags: []params.Tag{ |
| 626 | { |
| 627 | Name: "tag1", |
| 628 | }, |
| 629 | { |
| 630 | Name: "tag3", |
| 631 | }, |
| 632 | }, |
| 633 | } |
| 634 | |
| 635 | SetEntity(entity) |
| 636 | SetEntityPool(entity.ID, pool1) |
| 637 | SetEntityPool(entity.ID, pool2) |
| 638 | cachedEntity, ok := GetEntity(entity.ID) |
| 639 | c.Require().True(ok) |
| 640 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 641 | pools := GetEntityPools(entity.ID) |
| 642 | c.Require().Len(pools, 2) |
| 643 | c.Require().Contains(pools, pool1) |
| 644 | c.Require().Contains(pools, pool2) |
| 645 | } |
| 646 | |
| 647 | func (c *CacheTestSuite) TestGetEntityScaleSet() { |
| 648 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected