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

Function TestInspectcommandRemoteManifest

cli/command/manifest/inspect_test.go:119–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestInspectcommandRemoteManifest(t *testing.T) {
120 refStore := store.NewStore(t.TempDir())
121
122 cli := test.NewFakeCli(nil)
123 cli.SetManifestStore(refStore)
124 cli.SetRegistryClient(&fakeRegistryClient{
125 getManifestFunc: func(_ context.Context, ref reference.Named) (types.ImageManifest, error) {
126 return fullImageManifest(t, ref), nil
127 },
128 })
129
130 cmd := newInspectCommand(cli)
131 cmd.SetOut(io.Discard)
132 cmd.SetArgs([]string{"example.com/alpine:3.0"})
133 assert.NilError(t, cmd.Execute())
134 actual := cli.OutBuffer()
135 expected := golden.Get(t, "inspect-manifest.golden")
136 assert.Check(t, is.Equal(string(expected), actual.String()))
137}

Callers

nothing calls this directly

Calls 9

SetManifestStoreMethod · 0.95
SetRegistryClientMethod · 0.95
OutBufferMethod · 0.95
fullImageManifestFunction · 0.85
SetArgsMethod · 0.80
newInspectCommandFunction · 0.70
GetMethod · 0.65
StringMethod · 0.65
SetOutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…