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

Method TestGetAllGiteaCredentialsAsMap

cache/cache_test.go:1039–1055  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1037}
1038
1039func (c *CacheTestSuite) TestGetAllGiteaCredentialsAsMap() {
1040 credentials1 := params.ForgeCredentials{
1041 ID: 1,
1042 CreatedAt: time.Now(),
1043 }
1044 credentials2 := params.ForgeCredentials{
1045 ID: 2,
1046 CreatedAt: time.Now().Add(1 * time.Second),
1047 }
1048 SetGiteaCredentials(credentials1)
1049 SetGiteaCredentials(credentials2)
1050
1051 cachedCreds := GetAllGiteaCredentialsAsMap()
1052 c.Require().Len(cachedCreds, 2)
1053 c.Require().Contains(cachedCreds, credentials1.ID)
1054 c.Require().Contains(cachedCreds, credentials2.ID)
1055}
1056
1057func (c *CacheTestSuite) TestGetEntityForPool() {
1058 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 4

SetGiteaCredentialsFunction · 0.85
AddMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected