MCPcopy
hub / github.com/docker/compose / TestDisplayLocationRemoteStack

Function TestDisplayLocationRemoteStack

cmd/compose/options_test.go:185–208  ·  cmd/compose/options_test.go::TestDisplayLocationRemoteStack
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestDisplayLocationRemoteStack(t *testing.T) {
186 ctrl := gomock.NewController(t)
187 defer ctrl.Finish()
188 cli := mocks.NewMockCli(ctrl)
189
190 buf := new(bytes.Buffer)
191 cli.EXPECT().Out().Return(streams.NewOut(buf)).AnyTimes()
192
193 project := &types.Project{
194 Name: "test-project",
195 WorkingDir: "/tmp/test",
196 }
197
198 options := buildOptions{
199 ProjectOptions: &ProjectOptions{
200 ConfigPaths: []string{"oci://registry.example.com/stack:latest"},
201 },
202 }
203
204 displayLocationRemoteStack(cli, project, options)
205
206 output := buf.String()
207 assert.Equal(t, output, fmt.Sprintf("Your compose stack %q is stored in %q\n", "oci://registry.example.com/stack:latest", "/tmp/test"))
208}
209
210func TestDisplayInterpolationVariables(t *testing.T) {
211 ctrl := gomock.NewController(t)

Callers

nothing calls this directly

Calls 5

EXPECTMethod · 0.95
NewMockCliFunction · 0.92
OutMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected