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

Function TestNodeListQuietShouldOnlyPrintIDs

cli/command/node/list_test.go:82–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func TestNodeListQuietShouldOnlyPrintIDs(t *testing.T) {
83 cli := test.NewFakeCli(&fakeClient{
84 nodeListFunc: func() (client.NodeListResult, error) {
85 return client.NodeListResult{
86 Items: []swarm.Node{
87 *builders.Node(builders.NodeID("nodeID1")),
88 },
89 }, nil
90 },
91 })
92 cmd := newListCommand(cli)
93 assert.Check(t, cmd.Flags().Set("quiet", "true"))
94 assert.NilError(t, cmd.Execute())
95 assert.Check(t, is.Equal(cli.OutBuffer().String(), "nodeID1\n"))
96}
97
98func TestNodeListDefaultFormatFromConfig(t *testing.T) {
99 cli := test.NewFakeCli(&fakeClient{

Callers

nothing calls this directly

Calls 5

OutBufferMethod · 0.95
NodeMethod · 0.80
newListCommandFunction · 0.70
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…