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

Function TestRunPSQuiet

cli/command/service/ps_test.go:94–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestRunPSQuiet(t *testing.T) {
95 apiClient := &fakeClient{
96 serviceListFunc: func(ctx context.Context, options client.ServiceListOptions) (client.ServiceListResult, error) {
97 return client.ServiceListResult{
98 Items: []swarm.Service{{ID: "foo"}},
99 }, nil
100 },
101 taskListFunc: func(ctx context.Context, options client.TaskListOptions) (client.TaskListResult, error) {
102 return client.TaskListResult{
103 Items: []swarm.Task{{ID: "sxabyp0obqokwekpun4rjo0b3"}},
104 }, nil
105 },
106 }
107
108 cli := test.NewFakeCli(apiClient)
109 ctx := context.Background()
110 err := runPS(ctx, cli, psOptions{services: []string{"foo"}, quiet: true, filter: opts.NewFilterOpt()})
111 assert.NilError(t, err)
112 assert.Check(t, is.Equal("sxabyp0obqokwekpun4rjo0b3\n", cli.OutBuffer().String()))
113}
114
115func TestUpdateNodeFilter(t *testing.T) {
116 selfNodeID := "foofoo"

Callers

nothing calls this directly

Calls 3

OutBufferMethod · 0.95
runPSFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…