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

Function TestInspectCommandNotFound

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

Source from the content-addressed store, hash-verified

77}
78
79func TestInspectCommandNotFound(t *testing.T) {
80 refStore := store.NewStore(t.TempDir())
81
82 cli := test.NewFakeCli(nil)
83 cli.SetManifestStore(refStore)
84 cli.SetRegistryClient(&fakeRegistryClient{
85 getManifestFunc: func(_ context.Context, _ reference.Named) (types.ImageManifest, error) {
86 return types.ImageManifest{}, errors.New("missing")
87 },
88 getManifestListFunc: func(ctx context.Context, ref reference.Named) ([]types.ImageManifest, error) {
89 return nil, errors.New("No such manifest: " + ref.String())
90 },
91 })
92
93 cmd := newInspectCommand(cli)
94 cmd.SetOut(io.Discard)
95 cmd.SetErr(io.Discard)
96 cmd.SetArgs([]string{"example.com/alpine:3.0"})
97 err := cmd.Execute()
98 assert.Error(t, err, "No such manifest: example.com/alpine:3.0")
99}
100
101func TestInspectCommandLocalManifest(t *testing.T) {
102 refStore := store.NewStore(t.TempDir())

Callers

nothing calls this directly

Calls 8

SetManifestStoreMethod · 0.95
SetRegistryClientMethod · 0.95
SetArgsMethod · 0.80
newInspectCommandFunction · 0.70
StringMethod · 0.65
SetOutMethod · 0.45
SetErrMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…