MCPcopy Create free account
hub / github.com/google/go-github / TestUsersService_IsFollowing_false

Function TestUsersService_IsFollowing_false

github/users_followers_test.go:244–275  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

242}
243
244func TestUsersService_IsFollowing_false(t *testing.T) {
245 t.Parallel()
246 client, mux, _ := setup(t)
247
248 mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) {
249 testMethod(t, r, "GET")
250 w.WriteHeader(http.StatusNotFound)
251 })
252
253 ctx := t.Context()
254 following, _, err := client.Users.IsFollowing(ctx, "u", "t")
255 if err != nil {
256 t.Errorf("Users.IsFollowing returned error: %v", err)
257 }
258 if want := false; following != want {
259 t.Errorf("Users.IsFollowing returned %+v, want %+v", following, want)
260 }
261
262 const methodName = "IsFollowing"
263 testBadOptions(t, methodName, func() (err error) {
264 _, _, err = client.Users.IsFollowing(ctx, "\n", "\n")
265 return err
266 })
267
268 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
269 got, resp, err := client.Users.IsFollowing(ctx, "u", "t")
270 if got {
271 t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got)
272 }
273 return resp, err
274 })
275}
276
277func TestUsersService_IsFollowing_error(t *testing.T) {
278 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
IsFollowingMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…