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

Function newTestService

pkg/compose/executor_test.go:41–51  ·  pkg/compose/executor_test.go::newTestService
(t *testing.T)

Source from the content-addressed store, hash-verified

39func (noopEventProcessor) Done(_ string, _ bool) {}
40
41func newTestService(t *testing.T) (*composeService, *mocks.MockAPIClient) {
42 t.Helper()
43 mockCtrl := gomock.NewController(t)
44 cli := mocks.NewMockCli(mockCtrl)
45 apiClient := mocks.NewMockAPIClient(mockCtrl)
46 cli.EXPECT().Client().Return(apiClient).AnyTimes()
47
48 svc, err := NewComposeService(cli, WithEventProcessor(noopEventProcessor{}))
49 assert.NilError(t, err)
50 return svc.(*composeService), apiClient
51}
52
53func TestExecutePlanEmpty(t *testing.T) {
54 svc, _ := newTestService(t)

Calls 6

EXPECTMethod · 0.95
NewMockCliFunction · 0.92
NewMockAPIClientFunction · 0.92
NewComposeServiceFunction · 0.85
WithEventProcessorFunction · 0.85
ClientMethod · 0.45

Tested by

no test coverage detected