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

Function TestStackServicesWithFormat

cli/command/stack/services_test.go:101–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestStackServicesWithFormat(t *testing.T) {
102 cli := test.NewFakeCli(&fakeClient{
103 serviceListFunc: func(options client.ServiceListOptions) (client.ServiceListResult, error) {
104 return client.ServiceListResult{
105 Items: []swarm.Service{*builders.Service(builders.ServiceName("service-name-foo"))},
106 }, nil
107 },
108 })
109 cmd := newServicesCommand(cli)
110 cmd.SetArgs([]string{"foo"})
111 assert.Check(t, cmd.Flags().Set("format", "{{ .Name }}"))
112 assert.NilError(t, cmd.Execute())
113 golden.Assert(t, cli.OutBuffer().String(), "stack-services-with-format.golden")
114}
115
116func TestStackServicesWithConfigFormat(t *testing.T) {
117 cli := test.NewFakeCli(&fakeClient{

Callers

nothing calls this directly

Calls 5

OutBufferMethod · 0.95
newServicesCommandFunction · 0.85
SetArgsMethod · 0.80
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…