MCPcopy
hub / github.com/helm/helm / TestSecretCreate

Function TestSecretCreate

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

Source from the content-addressed store, hash-verified

171}
172
173func TestSecretCreate(t *testing.T) {
174 secrets := newTestFixtureSecrets(t)
175
176 vers := 1
177 name := "smug-pigeon"
178 namespace := "default"
179 key := testKey(name, vers)
180 rel := releaseStub(name, vers, namespace, common.StatusDeployed)
181
182 // store the release in a secret
183 if err := secrets.Create(key, rel); err != nil {
184 t.Fatalf("Failed to create release with key %q: %s", key, err)
185 }
186
187 // get the release back
188 got, err := secrets.Get(key)
189 if err != nil {
190 t.Fatalf("Failed to get release with key %q: %s", key, err)
191 }
192
193 // compare created release with original
194 if !reflect.DeepEqual(rel, got) {
195 t.Errorf("Expected {%v}, got {%v}", rel, got)
196 }
197}
198
199func TestSecretUpdate(t *testing.T) {
200 vers := 1

Callers

nothing calls this directly

Calls 6

newTestFixtureSecretsFunction · 0.85
FatalfMethod · 0.80
testKeyFunction · 0.70
releaseStubFunction · 0.70
CreateMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…