(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestConfigUpdateError(t *testing.T) { |
| 13 | client, err := New( |
| 14 | WithMockClient(errorMock(http.StatusInternalServerError, "Server error")), |
| 15 | ) |
| 16 | assert.NilError(t, err) |
| 17 | |
| 18 | _, err = client.ConfigUpdate(t.Context(), "config_id", ConfigUpdateOptions{}) |
| 19 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) |
| 20 | |
| 21 | _, err = client.ConfigUpdate(t.Context(), "", ConfigUpdateOptions{}) |
| 22 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) |
| 23 | assert.Check(t, is.ErrorContains(err, "value is empty")) |
| 24 | |
| 25 | _, err = client.ConfigUpdate(t.Context(), " ", ConfigUpdateOptions{}) |
| 26 | assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) |
| 27 | assert.Check(t, is.ErrorContains(err, "value is empty")) |
| 28 | } |
| 29 | |
| 30 | func TestConfigUpdate(t *testing.T) { |
| 31 | const expectedURL = "/configs/config_id/update" |
nothing calls this directly
no test coverage detected
searching dependent graphs…