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

Function TestIssuesService_ListRepositoryEvents

github/issues_events_test.go:57–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestIssuesService_ListRepositoryEvents(t *testing.T) {
58 t.Parallel()
59 client, mux, _ := setup(t)
60
61 mux.HandleFunc("/repos/o/r/issues/events", func(w http.ResponseWriter, r *http.Request) {
62 testMethod(t, r, "GET")
63 testFormValues(t, r, values{
64 "page": "1",
65 "per_page": "2",
66 })
67 fmt.Fprint(w, `[{"id":1}]`)
68 })
69
70 opt := &ListOptions{Page: 1, PerPage: 2}
71 ctx := t.Context()
72 events, _, err := client.Issues.ListRepositoryEvents(ctx, "o", "r", opt)
73 if err != nil {
74 t.Errorf("Issues.ListRepositoryEvents returned error: %v", err)
75 }
76
77 want := []*IssueEvent{{ID: Ptr(int64(1))}}
78 if !cmp.Equal(events, want) {
79 t.Errorf("Issues.ListRepositoryEvents returned %+v, want %+v", events, want)
80 }
81
82 const methodName = "ListRepositoryEvents"
83 testBadOptions(t, methodName, func() (err error) {
84 _, _, err = client.Issues.ListRepositoryEvents(ctx, "\n", "\n", &ListOptions{})
85 return err
86 })
87
88 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
89 got, resp, err := client.Issues.ListRepositoryEvents(ctx, "o", "r", nil)
90 if got != nil {
91 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
92 }
93 return resp, err
94 })
95}
96
97func TestIssuesService_GetEvent(t *testing.T) {
98 t.Parallel()

Callers

nothing calls this directly

Calls 8

testMethodFunction · 0.85
testFormValuesFunction · 0.85
testBadOptionsFunction · 0.85
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70
ListRepositoryEventsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…