(t *testing.T)
| 151 | } |
| 152 | |
| 153 | func TestRepositoriesService_DeleteKey(t *testing.T) { |
| 154 | t.Parallel() |
| 155 | client, mux, _ := setup(t) |
| 156 | |
| 157 | mux.HandleFunc("/repos/o/r/keys/1", func(_ http.ResponseWriter, r *http.Request) { |
| 158 | testMethod(t, r, "DELETE") |
| 159 | }) |
| 160 | |
| 161 | ctx := t.Context() |
| 162 | _, err := client.Repositories.DeleteKey(ctx, "o", "r", 1) |
| 163 | if err != nil { |
| 164 | t.Errorf("Repositories.DeleteKey returned error: %v", err) |
| 165 | } |
| 166 | |
| 167 | const methodName = "DeleteKey" |
| 168 | testBadOptions(t, methodName, func() (err error) { |
| 169 | _, err = client.Repositories.DeleteKey(ctx, "\n", "\n", -1) |
| 170 | return err |
| 171 | }) |
| 172 | |
| 173 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 174 | return client.Repositories.DeleteKey(ctx, "o", "r", 1) |
| 175 | }) |
| 176 | } |
| 177 | |
| 178 | func TestRepositoriesService_DeleteKey_invalidOwner(t *testing.T) { |
| 179 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…