()
| 946 | } |
| 947 | |
| 948 | func (c *CacheTestSuite) TestGetAllPools() { |
| 949 | entity := params.ForgeEntity{ |
| 950 | ID: "test-entity", |
| 951 | EntityType: params.ForgeEntityTypeOrganization, |
| 952 | Name: "test", |
| 953 | Owner: "test", |
| 954 | } |
| 955 | pool1 := params.Pool{ |
| 956 | ID: "pool-1", |
| 957 | OrgID: "test-entity", |
| 958 | CreatedAt: time.Now(), |
| 959 | Tags: []params.Tag{ |
| 960 | { |
| 961 | Name: "tag1", |
| 962 | }, |
| 963 | { |
| 964 | Name: "tag2", |
| 965 | }, |
| 966 | }, |
| 967 | } |
| 968 | |
| 969 | pool2 := params.Pool{ |
| 970 | ID: "pool-2", |
| 971 | OrgID: "test-entity", |
| 972 | CreatedAt: time.Now().Add(1 * time.Second), |
| 973 | Tags: []params.Tag{ |
| 974 | { |
| 975 | Name: "tag1", |
| 976 | }, |
| 977 | { |
| 978 | Name: "tag3", |
| 979 | }, |
| 980 | }, |
| 981 | } |
| 982 | |
| 983 | SetEntity(entity) |
| 984 | SetEntityPool(entity.ID, pool1) |
| 985 | SetEntityPool(entity.ID, pool2) |
| 986 | cachedEntity, ok := GetEntity(entity.ID) |
| 987 | c.Require().True(ok) |
| 988 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 989 | pools := GetAllPools() |
| 990 | c.Require().Len(pools, 2) |
| 991 | c.Require().Equal(pools[0].ID, pool1.ID) |
| 992 | c.Require().Equal(pools[1].ID, pool2.ID) |
| 993 | } |
| 994 | |
| 995 | func (c *CacheTestSuite) TestGetAllScaleSets() { |
| 996 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected