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

Function TestActivityService_List

github/activity_test.go:15–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestActivityService_List(t *testing.T) {
16 t.Parallel()
17 client, mux, _ := setup(t)
18
19 mux.HandleFunc("/feeds", func(w http.ResponseWriter, r *http.Request) {
20 testMethod(t, r, "GET")
21
22 w.WriteHeader(http.StatusOK)
23 assertWrite(t, w, feedsJSON)
24 })
25
26 ctx := t.Context()
27 got, _, err := client.Activity.ListFeeds(ctx)
28 if err != nil {
29 t.Errorf("Activity.ListFeeds returned error: %v", err)
30 }
31 if want := wantFeeds; !cmp.Equal(got, want) {
32 t.Errorf("Activity.ListFeeds = %+v, want %+v", got, want)
33 }
34
35 const methodName = "ListFeeds"
36 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
37 got, resp, err := client.Activity.ListFeeds(ctx)
38 if got != nil {
39 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
40 }
41 return resp, err
42 })
43}
44
45var feedsJSON = []byte(`{
46 "timeline_url": "https://github.com/timeline",

Callers

nothing calls this directly

Calls 6

testMethodFunction · 0.85
assertWriteFunction · 0.85
ListFeedsMethod · 0.80
EqualMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…