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

Function TestMetadataRespectJsonAnnotation

cli/context/store/metadata_test.go:66–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestMetadataRespectJsonAnnotation(t *testing.T) {
67 testDir := t.TempDir()
68 testee := metadataStore{root: testDir, config: testCfg}
69 assert.NilError(t, testee.createOrUpdate(testMetadata("test")))
70 bytes, err := os.ReadFile(filepath.Join(testDir, string(contextdirOf("test")), "meta.json"))
71 assert.NilError(t, err)
72 assert.Assert(t, is.Contains(string(bytes), "a_very_recognizable_field_name"))
73 assert.Assert(t, is.Contains(string(bytes), "another_very_recognizable_field_name"))
74}
75
76func TestMetadataList(t *testing.T) {
77 testee := metadataStore{root: t.TempDir(), config: testCfg}

Callers

nothing calls this directly

Calls 4

createOrUpdateMethod · 0.95
testMetadataFunction · 0.85
contextdirOfFunction · 0.85
ContainsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…