MCPcopy Index your code
hub / github.com/google/go-github / TestRepositoriesService_DeleteKey

Function TestRepositoriesService_DeleteKey

github/repos_keys_test.go:153–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

151}
152
153func 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
178func TestRepositoriesService_DeleteKey_invalidOwner(t *testing.T) {
179 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
setupFunction · 0.70
DeleteKeyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…