1
0
Fork 0
mirror of https://github.com/Luzifer/repo-template.git synced 2024-12-25 05:31:20 +00:00
repo-template/vendor/github.com/google/go-github/test/integration/pulls_test.go

29 lines
780 B
Go
Raw Normal View History

2018-02-07 09:03:05 +00:00
// 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.
// +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)
}
}