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

Function TestStackServicesWithConfigFormat

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

Source from the content-addressed store, hash-verified

114}
115
116func TestStackServicesWithConfigFormat(t *testing.T) {
117 cli := test.NewFakeCli(&fakeClient{
118 serviceListFunc: func(options client.ServiceListOptions) (client.ServiceListResult, error) {
119 return client.ServiceListResult{
120 Items: []swarm.Service{*builders.Service(builders.ServiceName("service-name-foo"))},
121 }, nil
122 },
123 })
124 cli.SetConfigFile(&configfile.ConfigFile{
125 ServicesFormat: "{{ .Name }}",
126 })
127 cmd := newServicesCommand(cli)
128 cmd.SetArgs([]string{"foo"})
129 assert.NilError(t, cmd.Execute())
130 golden.Assert(t, cli.OutBuffer().String(), "stack-services-with-config-format.golden")
131}
132
133func TestStackServicesWithoutFormat(t *testing.T) {
134 cli := test.NewFakeCli(&fakeClient{

Callers

nothing calls this directly

Calls 5

SetConfigFileMethod · 0.95
OutBufferMethod · 0.95
newServicesCommandFunction · 0.85
SetArgsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…