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

Function TestUsersService_ListKeys_specifiedUser

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

Source from the content-addressed store, hash-verified

51}
52
53func TestUsersService_ListKeys_specifiedUser(t *testing.T) {
54 t.Parallel()
55 client, mux, _ := setup(t)
56
57 mux.HandleFunc("/users/u/keys", func(w http.ResponseWriter, r *http.Request) {
58 testMethod(t, r, "GET")
59 fmt.Fprint(w, `[{"id":1}]`)
60 })
61
62 ctx := t.Context()
63 keys, _, err := client.Users.ListKeys(ctx, "u", nil)
64 if err != nil {
65 t.Errorf("Users.ListKeys returned error: %v", err)
66 }
67
68 want := []*Key{{ID: Ptr(int64(1))}}
69 if !cmp.Equal(keys, want) {
70 t.Errorf("Users.ListKeys returned %+v, want %+v", keys, want)
71 }
72}
73
74func TestUsersService_ListKeys_invalidUser(t *testing.T) {
75 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70
ListKeysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…