MCPcopy
hub / github.com/fluid-cloudnative/fluid / TestCacheDirInjectionEnabled

Function TestCacheDirInjectionEnabled

pkg/utils/annotations_test.go:151–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestCacheDirInjectionEnabled(t *testing.T) {
152 type testCase struct {
153 name string
154 annotations map[string]string
155 expect bool
156 }
157
158 testcases := []testCase{
159 {
160 name: "enable_Injection_done",
161 annotations: map[string]string{
162 common.InjectCacheDir: "true",
163 },
164 expect: true,
165 }, {
166 name: "disable_Injection_done",
167 annotations: map[string]string{
168 common.InjectCacheDir: "false",
169 },
170 expect: false,
171 }, {
172 name: "no_Injection",
173 annotations: map[string]string{
174 "test": "false",
175 },
176 expect: false,
177 },
178 }
179
180 for _, testcase := range testcases {
181 got := InjectCacheDirEnabled(testcase.annotations)
182 if got != testcase.expect {
183 t.Errorf("The testcase %s's failed due to expect %v but got %v", testcase.name, testcase.expect, got)
184 }
185 }
186}
187
188func TestServerlessPlatformMatched(t *testing.T) {
189 type envPlatform struct {

Callers

nothing calls this directly

Calls 1

InjectCacheDirEnabledFunction · 0.85

Tested by

no test coverage detected