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

Function TestRunDiffClientError

cli/command/container/diff_test.go:59–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestRunDiffClientError(t *testing.T) {
60 clientError := errors.New("client error")
61
62 cli := test.NewFakeCli(&fakeClient{
63 containerDiffFunc: func(ctx context.Context, containerID string) (client.ContainerDiffResult, error) {
64 return client.ContainerDiffResult{}, clientError
65 },
66 })
67
68 cmd := newDiffCommand(cli)
69 cmd.SetOut(io.Discard)
70 cmd.SetErr(io.Discard)
71
72 cmd.SetArgs([]string{"container-id"})
73
74 err := cmd.Execute()
75 assert.ErrorIs(t, err, clientError)
76}

Callers

nothing calls this directly

Calls 4

newDiffCommandFunction · 0.85
SetArgsMethod · 0.80
SetOutMethod · 0.45
SetErrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…