MCPcopy
hub / github.com/nektos/act / TestDockerCopyTarStreamErrorInCopyFiles

Function TestDockerCopyTarStreamErrorInCopyFiles

pkg/container/docker_run_test.go:223–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func TestDockerCopyTarStreamErrorInCopyFiles(t *testing.T) {
224 ctx := context.Background()
225
226 conn := &mockConn{}
227
228 merr := fmt.Errorf("Failure")
229
230 cli := &mockDockerClient{}
231 cli.On("CopyToContainer", ctx, "123", "/", mock.Anything, mock.AnythingOfType("client.CopyToContainerOptions")).Return(merr)
232 cli.On("CopyToContainer", ctx, "123", "/", mock.Anything, mock.AnythingOfType("client.CopyToContainerOptions")).Return(merr)
233 cr := &containerReference{
234 id: "123",
235 cli: cli,
236 input: &NewContainerInput{
237 Image: "image",
238 },
239 }
240
241 err := cr.CopyTarStream(ctx, "/var/run/act", &bytes.Buffer{})
242 assert.ErrorIs(t, err, merr)
243
244 conn.AssertExpectations(t)
245 cli.AssertExpectations(t)
246}
247
248func TestDockerCopyTarStreamErrorInMkdir(t *testing.T) {
249 ctx := context.Background()

Callers

nothing calls this directly

Calls 2

CopyTarStreamMethod · 0.95
OnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…