MCPcopy Create free account
hub / github.com/cloudbase/garm / TestGetAllInstances

Method TestGetAllInstances

cache/cache_test.go:244–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242}
243
244func (c *CacheTestSuite) TestGetAllInstances() {
245 instance1 := params.Instance{
246 Name: "test-instance-1",
247 }
248 instance2 := params.Instance{
249 Name: "test-instance-2",
250 }
251 SetInstanceCache(instance1)
252 SetInstanceCache(instance2)
253
254 cachedInstances := GetAllInstancesCache()
255 c.Require().Len(cachedInstances, 2)
256 c.Require().Contains(cachedInstances, instance1)
257 c.Require().Contains(cachedInstances, instance2)
258}
259
260func (c *CacheTestSuite) TestGetInstancesForPool() {
261 instance1 := params.Instance{

Callers

nothing calls this directly

Calls 3

SetInstanceCacheFunction · 0.85
GetAllInstancesCacheFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected