MCPcopy
hub / github.com/helm/helm / TestStorageUpdate

Function TestStorageUpdate

pkg/storage/storage_test.go:57–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestStorageUpdate(t *testing.T) {
58 // initialize storage
59 storage := Init(driver.NewMemory())
60
61 // create fake release
62 rls := ReleaseTestData{
63 Name: "angry-beaver",
64 Version: 1,
65 Status: common.StatusDeployed,
66 }.ToRelease()
67
68 assertErrNil(t.Fatal, storage.Create(rls), "StoreRelease")
69
70 // modify the release
71 rls.Info.Status = common.StatusUninstalled
72 assertErrNil(t.Fatal, storage.Update(rls), "UpdateRelease")
73
74 // retrieve the updated release
75 res, err := storage.Get(rls.Name, rls.Version)
76 assertErrNil(t.Fatal, err, "QueryRelease")
77
78 // verify updated and fetched releases are the same.
79 if !reflect.DeepEqual(rls, res) {
80 t.Fatalf("Expected %v, got %v", rls, res)
81 }
82}
83
84func TestStorageDelete(t *testing.T) {
85 // initialize storage

Callers

nothing calls this directly

Calls 8

NewMemoryFunction · 0.92
InitFunction · 0.85
assertErrNilFunction · 0.85
ToReleaseMethod · 0.80
FatalfMethod · 0.80
CreateMethod · 0.65
UpdateMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…