MCPcopy
hub / github.com/helm/helm / TestSecretDelete

Function TestSecretDelete

pkg/storage/driver/secrets_test.go:229–256  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestSecretDelete(t *testing.T) {
230 vers := 1
231 name := "smug-pigeon"
232 namespace := "default"
233 key := testKey(name, vers)
234 rel := releaseStub(name, vers, namespace, common.StatusDeployed)
235
236 secrets := newTestFixtureSecrets(t, []*rspb.Release{rel}...)
237
238 // perform the delete on a non-existing release
239 _, err := secrets.Delete("nonexistent")
240 if !errors.Is(err, ErrReleaseNotFound) {
241 t.Fatalf("Expected ErrReleaseNotFound, got: {%v}", err)
242 }
243
244 // perform the delete
245 rls, err := secrets.Delete(key)
246 if err != nil {
247 t.Fatalf("Failed to delete release with key %q: %s", key, err)
248 }
249 if !reflect.DeepEqual(rel, rls) {
250 t.Errorf("Expected {%v}, got {%v}", rel, rls)
251 }
252 _, err = secrets.Get(key)
253 if !errors.Is(err, ErrReleaseNotFound) {
254 t.Errorf("Expected {%v}, got {%v}", ErrReleaseNotFound, err)
255 }
256}

Callers

nothing calls this directly

Calls 7

newTestFixtureSecretsFunction · 0.85
IsMethod · 0.80
FatalfMethod · 0.80
testKeyFunction · 0.70
releaseStubFunction · 0.70
DeleteMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…