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