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

Function TestSecretRemoveWithName

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

Source from the content-addressed store, hash-verified

45}
46
47func TestSecretRemoveWithName(t *testing.T) {
48 names := []string{"foo", "bar"}
49 var removedSecrets []string
50 cli := test.NewFakeCli(&fakeClient{
51 secretRemoveFunc: func(_ context.Context, name string, _ client.SecretRemoveOptions) (client.SecretRemoveResult, error) {
52 removedSecrets = append(removedSecrets, name)
53 return client.SecretRemoveResult{}, nil
54 },
55 })
56 cmd := newSecretRemoveCommand(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, removedSecrets))
61}
62
63func TestSecretRemoveContinueAfterError(t *testing.T) {
64 names := []string{"foo", "bar"}

Callers

nothing calls this directly

Calls 4

OutBufferMethod · 0.95
newSecretRemoveCommandFunction · 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…