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

Function TestSecretListWithQuietOption

cli/command/secret/ls_test.go:83–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestSecretListWithQuietOption(t *testing.T) {
84 cli := test.NewFakeCli(&fakeClient{
85 secretListFunc: func(_ context.Context, options client.SecretListOptions) (client.SecretListResult, error) {
86 return client.SecretListResult{
87 Items: []swarm.Secret{
88 *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")),
89 *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{
90 "label": "label-bar",
91 })),
92 },
93 }, nil
94 },
95 })
96 cmd := newSecretListCommand(cli)
97 assert.Check(t, cmd.Flags().Set("quiet", "true"))
98 assert.NilError(t, cmd.Execute())
99 golden.Assert(t, cli.OutBuffer().String(), "secret-list-with-quiet-option.golden")
100}
101
102func TestSecretListWithConfigFormat(t *testing.T) {
103 cli := test.NewFakeCli(&fakeClient{

Callers

nothing calls this directly

Calls 4

OutBufferMethod · 0.95
newSecretListCommandFunction · 0.85
StringMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…