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

Method TestSetToolsCacheWorks

cache/cache_test.go:69–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69func (c *CacheTestSuite) TestSetToolsCacheWorks() {
70 tools := []commonParams.RunnerApplicationDownload{
71 {
72 DownloadURL: garmTesting.Ptr("https://example.com"),
73 },
74 }
75 c.Require().NotNil(githubToolsCache)
76 c.Require().Len(githubToolsCache.entities, 0)
77 SetGithubToolsCache(c.entity, tools)
78 c.Require().Len(githubToolsCache.entities, 1)
79 cachedTools, err := GetGithubToolsCache(c.entity.ID)
80 c.Require().NoError(err)
81 c.Require().Len(cachedTools, 1)
82 c.Require().Equal(tools[0].GetDownloadURL(), cachedTools[0].GetDownloadURL())
83}
84
85func (c *CacheTestSuite) TestSetToolsCacheWithError() {
86 tools := []commonParams.RunnerApplicationDownload{

Callers

nothing calls this directly

Calls 3

SetGithubToolsCacheFunction · 0.85
GetGithubToolsCacheFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected