(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestExecCreateError(t *testing.T) { |
| 17 | client, err := New( |
| 18 | WithMockClient(errorMock(http.StatusInternalServerError, "Server error")), |
| 19 | ) |
| 20 | assert.NilError(t, err) |
| 21 | |
| 22 | _, err = client.ExecCreate(t.Context(), "container_id", ExecCreateOptions{}) |
| 23 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) |
| 24 | |
| 25 | _, err = client.ExecCreate(t.Context(), "", ExecCreateOptions{}) |
| 26 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) |
| 27 | assert.Check(t, is.ErrorContains(err, "value is empty")) |
| 28 | |
| 29 | _, err = client.ExecCreate(t.Context(), " ", ExecCreateOptions{}) |
| 30 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) |
| 31 | assert.Check(t, is.ErrorContains(err, "value is empty")) |
| 32 | } |
| 33 | |
| 34 | // TestExecCreateConnectionError verifies that connection errors occurring |
| 35 | // during API-version negotiation are not shadowed by API-version errors. |
nothing calls this directly
no test coverage detected
searching dependent graphs…