MCPcopy
hub / github.com/helm/helm / TestConfigMapUpdate

Function TestConfigMapUpdate

pkg/storage/driver/cfgmaps_test.go:214–242  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func TestConfigMapUpdate(t *testing.T) {
215 vers := 1
216 name := "smug-pigeon"
217 namespace := "default"
218 key := testKey(name, vers)
219 rel := releaseStub(name, vers, namespace, common.StatusDeployed)
220
221 cfgmaps := newTestFixtureCfgMaps(t, []*rspb.Release{rel}...)
222
223 // modify release status code
224 rel.Info.Status = common.StatusSuperseded
225
226 // perform the update
227 if err := cfgmaps.Update(key, rel); err != nil {
228 t.Fatalf("Failed to update release: %s", err)
229 }
230
231 // fetch the updated release
232 goti, err := cfgmaps.Get(key)
233 if err != nil {
234 t.Fatalf("Failed to get release with key %q: %s", key, err)
235 }
236 got := convertReleaserToV1(t, goti)
237
238 // check release has actually been updated by comparing modified fields
239 if rel.Info.Status != got.Info.Status {
240 t.Errorf("Expected status %s, got status %s", rel.Info.Status.String(), got.Info.Status.String())
241 }
242}
243
244func TestConfigMapDelete(t *testing.T) {
245 vers := 1

Callers

nothing calls this directly

Calls 8

newTestFixtureCfgMapsFunction · 0.85
convertReleaserToV1Function · 0.85
FatalfMethod · 0.80
testKeyFunction · 0.70
releaseStubFunction · 0.70
UpdateMethod · 0.65
GetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…