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

Function TestUsersService_DeleteKey

github/users_keys_test.go:151–174  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestUsersService_DeleteKey(t *testing.T) {
152 t.Parallel()
153 client, mux, _ := setup(t)
154
155 mux.HandleFunc("/user/keys/1", func(_ http.ResponseWriter, r *http.Request) {
156 testMethod(t, r, "DELETE")
157 })
158
159 ctx := t.Context()
160 _, err := client.Users.DeleteKey(ctx, 1)
161 if err != nil {
162 t.Errorf("Users.DeleteKey returned error: %v", err)
163 }
164
165 const methodName = "DeleteKey"
166 testBadOptions(t, methodName, func() (err error) {
167 _, err = client.Users.DeleteKey(ctx, -1)
168 return err
169 })
170
171 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
172 return client.Users.DeleteKey(ctx, 1)
173 })
174}
175
176func TestKey_Marshal(t *testing.T) {
177 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…