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

Function TestTaskPrintWithGlobalService

cli/command/task/print_test.go:91–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestTaskPrintWithGlobalService(t *testing.T) {
92 const quiet = false
93 const trunc = false
94 const noResolve = true
95 apiClient := &fakeClient{}
96 cli := test.NewFakeCli(apiClient)
97 tasks := client.TaskListResult{
98 Items: []swarm.Task{
99 *builders.Task(builders.TaskServiceID("service-id-foo"), builders.TaskNodeID("node-id-bar"), builders.TaskSlot(0)),
100 },
101 }
102 err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .Name }}")
103 assert.NilError(t, err)
104 golden.Assert(t, cli.OutBuffer().String(), "task-print-with-global-service.golden")
105}
106
107func TestTaskPrintWithReplicatedService(t *testing.T) {
108 const quiet = false

Callers

nothing calls this directly

Calls 3

OutBufferMethod · 0.95
PrintFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…