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

Function TestDockerCopyTarStreamErrorInMkdir

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

Source from the content-addressed store, hash-verified

246}
247
248func TestDockerCopyTarStreamErrorInMkdir(t *testing.T) {
249 ctx := context.Background()
250
251 conn := &mockConn{}
252
253 merr := fmt.Errorf("Failure")
254
255 cli := &mockDockerClient{}
256 cli.On("CopyToContainer", ctx, "123", "/", mock.Anything, mock.AnythingOfType("client.CopyToContainerOptions")).Return(nil)
257 cli.On("CopyToContainer", ctx, "123", "/var/run/act", mock.Anything, mock.AnythingOfType("client.CopyToContainerOptions")).Return(merr)
258 cr := &containerReference{
259 id: "123",
260 cli: cli,
261 input: &NewContainerInput{
262 Image: "image",
263 },
264 }
265
266 err := cr.CopyTarStream(ctx, "/var/run/act", &bytes.Buffer{})
267 assert.ErrorIs(t, err, merr)
268
269 conn.AssertExpectations(t)
270 cli.AssertExpectations(t)
271}
272
273// Type assert containerReference implements ExecutionsEnvironment
274var _ ExecutionsEnvironment = &containerReference{}

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…