| 105 | } |
| 106 | |
| 107 | func TestTaskPrintWithReplicatedService(t *testing.T) { |
| 108 | const quiet = false |
| 109 | const trunc = false |
| 110 | const noResolve = true |
| 111 | apiClient := &fakeClient{} |
| 112 | cli := test.NewFakeCli(apiClient) |
| 113 | tasks := client.TaskListResult{ |
| 114 | Items: []swarm.Task{ |
| 115 | *builders.Task(builders.TaskServiceID("service-id-foo"), builders.TaskSlot(1)), |
| 116 | }, |
| 117 | } |
| 118 | err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .Name }}") |
| 119 | assert.NilError(t, err) |
| 120 | golden.Assert(t, cli.OutBuffer().String(), "task-print-with-replicated-service.golden") |
| 121 | } |
| 122 | |
| 123 | func TestTaskPrintWithIndentation(t *testing.T) { |
| 124 | const quiet = false |