(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func 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 |
| 274 | var _ ExecutionsEnvironment = &containerReference{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…