(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func 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 | |
| 74 | func TestUsersService_ListKeys_invalidUser(t *testing.T) { |
| 75 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…