MCPcopy Index your code
hub / github.com/docker/cli / TestInspect

Function TestInspect

cli/command/context/inspect_test.go:11–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestInspect(t *testing.T) {
12 cli := makeFakeCli(t)
13 createTestContext(t, cli, "current", map[string]any{
14 "MyCustomMetadata": "MyCustomMetadataValue",
15 })
16 cli.OutBuffer().Reset()
17 assert.NilError(t, runInspect(cli, inspectOptions{
18 refs: []string{"current"},
19 }))
20 expected := string(golden.Get(t, "inspect.golden"))
21 si := cli.ContextStore().GetStorageInfo("current")
22 expected = strings.Replace(expected, "<METADATA_PATH>", strings.ReplaceAll(si.MetadataPath, `\`, `\\`), 1)
23 expected = strings.Replace(expected, "<TLS_PATH>", strings.ReplaceAll(si.TLSPath, `\`, `\\`), 1)
24 assert.Equal(t, cli.OutBuffer().String(), expected)
25}

Callers

nothing calls this directly

Calls 8

makeFakeCliFunction · 0.85
createTestContextFunction · 0.85
runInspectFunction · 0.70
GetMethod · 0.65
GetStorageInfoMethod · 0.65
ContextStoreMethod · 0.65
StringMethod · 0.65
OutBufferMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…