File: pulls_test.go

package info (click to toggle)
golang-github-google-go-github 60.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,700 kB
  • sloc: sh: 111; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 803 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build integration
// +build integration

package integration

import (
	"context"
	"testing"
)

func TestPullRequests_ListCommits(t *testing.T) {
	commits, _, err := client.PullRequests.ListCommits(context.Background(), "google", "go-github", 2, nil)
	if err != nil {
		t.Fatalf("PullRequests.ListCommits() returned error: %v", err)
	}

	if got, want := len(commits), 3; got != want {
		t.Fatalf("PullRequests.ListCommits() returned %d commits, want %d", got, want)
	}

	if got, want := *commits[0].Author.Login, "sqs"; got != want {
		t.Fatalf("PullRequests.ListCommits()[0].Author.Login returned %v, want %v", got, want)
	}
}