()
| 1105 | } |
| 1106 | |
| 1107 | func (c *CacheTestSuite) TestGetPoolByID() { |
| 1108 | entity := params.ForgeEntity{ |
| 1109 | ID: "test-entity", |
| 1110 | EntityType: params.ForgeEntityTypeOrganization, |
| 1111 | Name: "test", |
| 1112 | Owner: "test", |
| 1113 | } |
| 1114 | pool := params.Pool{ |
| 1115 | ID: "pool-1", |
| 1116 | OrgID: "test-entity", |
| 1117 | Enabled: true, |
| 1118 | Tags: []params.Tag{ |
| 1119 | { |
| 1120 | Name: "test-tag", |
| 1121 | }, |
| 1122 | }, |
| 1123 | } |
| 1124 | |
| 1125 | SetEntity(entity) |
| 1126 | SetEntityPool(entity.ID, pool) |
| 1127 | |
| 1128 | retrievedPool, ok := GetPoolByID(pool.ID) |
| 1129 | c.Require().True(ok) |
| 1130 | c.Require().Equal(pool.ID, retrievedPool.ID) |
| 1131 | c.Require().Equal(pool.Enabled, retrievedPool.Enabled) |
| 1132 | c.Require().Len(retrievedPool.Tags, 1) |
| 1133 | c.Require().Equal("test-tag", retrievedPool.Tags[0].Name) |
| 1134 | |
| 1135 | nonExistentPool, ok := GetPoolByID("non-existent-pool") |
| 1136 | c.Require().False(ok) |
| 1137 | c.Require().Equal(params.Pool{}, nonExistentPool) |
| 1138 | } |
| 1139 | |
| 1140 | func (c *CacheTestSuite) TestGetScaleSetByID() { |
| 1141 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected