MCPcopy Create free account
hub / github.com/docker/cli / TestStoreRemove

Function TestStoreRemove

cli/manifest/store/store_test.go:38–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestStoreRemove(t *testing.T) {
39 tmpDir := t.TempDir()
40 store := NewStore(tmpDir)
41 listRef := ref("list")
42 data := types.ImageManifest{Ref: sref(t, "abcdef")}
43 assert.NilError(t, store.Save(listRef, ref("manifest"), data))
44
45 files, err := os.ReadDir(tmpDir)
46 assert.NilError(t, err)
47 assert.Assert(t, is.Len(files, 1))
48
49 assert.Check(t, store.Remove(listRef))
50 files, err = os.ReadDir(tmpDir)
51 assert.NilError(t, err)
52 assert.Check(t, is.Len(files, 0))
53}
54
55func TestStoreSaveAndGet(t *testing.T) {
56 store := NewStore(t.TempDir())

Callers

nothing calls this directly

Calls 6

SaveMethod · 0.95
RemoveMethod · 0.95
NewStoreFunction · 0.85
srefFunction · 0.85
refFunction · 0.70
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…