github.com/google/go-github/v49@v49.1.0/test/integration/pulls_test.go (about) 1 // Copyright 2014 The go-github AUTHORS. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 //go:build integration 7 // +build integration 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 }