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

Function TestTimeline_ReviewRequests

github/issues_timeline_test.go:255–341  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

253}
254
255func TestTimeline_ReviewRequests(t *testing.T) {
256 t.Parallel()
257 client, mux, _ := setup(t)
258
259 mux.HandleFunc("/repos/example-org/example-repo/issues/3/timeline", func(w http.ResponseWriter, r *http.Request) {
260 testMethod(t, r, "GET")
261 fmt.Fprint(w, `[{
262 "id": 1234567890,
263 "url": "http://example.com/timeline/1",
264 "actor": {
265 "login": "actor-user",
266 "id": 1
267 },
268 "event": "review_requested",
269 "created_at": "2006-01-02T15:04:05Z",
270 "requested_reviewer": {
271 "login": "reviewer-user",
272 "id": 2
273 },
274 "review_requester": {
275 "login": "requester-user",
276 "id": 1
277 }
278 },
279 {
280 "id": 1234567891,
281 "url": "http://example.com/timeline/2",
282 "actor": {
283 "login": "actor-user",
284 "id": 1
285 },
286 "event": "review_request_removed",
287 "created_at": "2006-01-02T15:04:05Z",
288 "requested_reviewer": {
289 "login": "reviewer-user",
290 "id": 2
291 }
292 }]`)
293 })
294
295 ctx := t.Context()
296 events, _, err := client.Issues.ListIssueTimeline(ctx, "example-org", "example-repo", 3, nil)
297 if err != nil {
298 t.Errorf("Issues.ListIssueTimeline returned error: %v", err)
299 }
300
301 want := []*Timeline{
302 {
303 ID: Ptr(int64(1234567890)),
304 URL: Ptr("http://example.com/timeline/1"),
305 Actor: &User{
306 Login: Ptr("actor-user"),
307 ID: Ptr(int64(1)),
308 },
309 Event: Ptr("review_requested"),
310 CreatedAt: &Timestamp{referenceTime},
311 Reviewer: &User{
312 Login: Ptr("reviewer-user"),

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
ListIssueTimelineMethod · 0.80
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…