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

Function TestConfigRemoveWithName

cli/command/config/remove_test.go:47–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestConfigRemoveWithName(t *testing.T) {
48 names := []string{"foo", "bar"}
49 var removedConfigs []string
50 cli := test.NewFakeCli(&fakeClient{
51 configRemoveFunc: func(_ context.Context, name string, _ client.ConfigRemoveOptions) (client.ConfigRemoveResult, error) {
52 removedConfigs = append(removedConfigs, name)
53 return client.ConfigRemoveResult{}, nil
54 },
55 })
56 cmd := newConfigRemoveCommand(cli)
57 cmd.SetArgs(names)
58 assert.NilError(t, cmd.Execute())
59 assert.Check(t, is.DeepEqual(names, strings.Split(strings.TrimSpace(cli.OutBuffer().String()), "\n")))
60 assert.Check(t, is.DeepEqual(names, removedConfigs))
61}
62
63func TestConfigRemoveContinueAfterError(t *testing.T) {
64 names := []string{"foo", "bar"}

Callers

nothing calls this directly

Calls 4

OutBufferMethod · 0.95
newConfigRemoveCommandFunction · 0.85
SetArgsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…