...
1
2
3
4
5
6
7
8
9 package integration
10
11 import (
12 "context"
13 "testing"
14 )
15
16 func TestPullRequests_ListCommits(t *testing.T) {
17 commits, _, err := client.PullRequests.ListCommits(context.Background(), "google", "go-github", 2, nil)
18 if err != nil {
19 t.Fatalf("PullRequests.ListCommits() returned error: %v", err)
20 }
21
22 if got, want := len(commits), 3; got != want {
23 t.Fatalf("PullRequests.ListCommits() returned %d commits, want %d", got, want)
24 }
25
26 if got, want := *commits[0].Author.Login, "sqs"; got != want {
27 t.Fatalf("PullRequests.ListCommits()[0].Author.Login returned %v, want %v", got, want)
28 }
29 }
30
View as plain text