(t *testing.T)
| 221 | } |
| 222 | |
| 223 | func 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 | |
| 248 | func TestDockerCopyTarStreamErrorInMkdir(t *testing.T) { |
| 249 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…