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