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

Function TestRunPSWarnsOnNotFound

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

Source from the content-addressed store, hash-verified

71}
72
73func TestRunPSWarnsOnNotFound(t *testing.T) {
74 apiClient := &fakeClient{
75 serviceListFunc: func(ctx context.Context, options client.ServiceListOptions) (client.ServiceListResult, error) {
76 return client.ServiceListResult{
77 Items: []swarm.Service{{ID: "foo"}},
78 }, nil
79 },
80 }
81
82 cli := test.NewFakeCli(apiClient)
83 options := psOptions{
84 services: []string{"foo", "bar"},
85 filter: opts.NewFilterOpt(),
86 format: "{{.ID}}",
87 }
88
89 ctx := context.Background()
90 err := runPS(ctx, cli, options)
91 assert.Error(t, err, "no such service: bar")
92}
93
94func TestRunPSQuiet(t *testing.T) {
95 apiClient := &fakeClient{

Callers

nothing calls this directly

Calls 2

runPSFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…