Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions github/activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestActivityService_List(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Activity.ListFeeds(ctx)
got, _, err := client.Activity.ListFeeds(ctx)
if err != nil {
t.Errorf("Activity.ListFeeds returned error: %v", err)
}
Expand All @@ -35,7 +35,7 @@ func TestActivityService_List(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Activity.ListFeeds(ctx)
got, resp, err := client.Activity.ListFeeds(ctx)
if got != nil {
t.Errorf("client.BaseURL.Path='' ListFeeds = %#v, want nil", got)
}
Expand Down
3 changes: 3 additions & 0 deletions github/git_commits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ func TestGitService_CreateSignedCommitWithKey(t *testing.T) {
defer teardown()
s := strings.NewReader(testGPGKey)
keyring, err := openpgp.ReadArmoredKeyRing(s)
if err != nil {
t.Errorf("Error reading keyring: %+v", err)
}

date, _ := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Thu May 04 00:03:43 2017 +0200")
author := CommitAuthor{
Expand Down
8 changes: 4 additions & 4 deletions github/pulls_reviewers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestRequestReviewers(t *testing.T) {

// This returns a PR, unmarshalling of which is tested elsewhere
ctx := context.Background()
got, resp, err := client.PullRequests.RequestReviewers(ctx, "o", "r", 1, ReviewersRequest{Reviewers: []string{"octocat", "googlebot"}, TeamReviewers: []string{"justice-league", "injustice-league"}})
got, _, err := client.PullRequests.RequestReviewers(ctx, "o", "r", 1, ReviewersRequest{Reviewers: []string{"octocat", "googlebot"}, TeamReviewers: []string{"justice-league", "injustice-league"}})
if err != nil {
t.Errorf("PullRequests.RequestReviewers returned error: %v", err)
}
Expand All @@ -37,7 +37,7 @@ func TestRequestReviewers(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.PullRequests.RequestReviewers(ctx, "o", "r", 1, ReviewersRequest{Reviewers: []string{"octocat", "googlebot"}, TeamReviewers: []string{"justice-league", "injustice-league"}})
got, resp, err := client.PullRequests.RequestReviewers(ctx, "o", "r", 1, ReviewersRequest{Reviewers: []string{"octocat", "googlebot"}, TeamReviewers: []string{"justice-league", "injustice-league"}})
if got != nil {
t.Errorf("client.BaseURL.Path='' RequestReviewers = %#v, want nil", got)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestListReviewers(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.PullRequests.ListReviewers(ctx, "o", "r", 1, nil)
got, _, err := client.PullRequests.ListReviewers(ctx, "o", "r", 1, nil)
if err != nil {
t.Errorf("PullRequests.ListReviewers returned error: %v", err)
}
Expand All @@ -124,7 +124,7 @@ func TestListReviewers(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.PullRequests.ListReviewers(ctx, "o", "r", 1, nil)
got, resp, err := client.PullRequests.ListReviewers(ctx, "o", "r", 1, nil)
if got != nil {
t.Errorf("client.BaseURL.Path='' ListReviewers = %#v, want nil", got)
}
Expand Down
40 changes: 20 additions & 20 deletions github/repos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestRepositoriesService_List_authenticatedUser(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.List(ctx, "", nil)
got, _, err := client.Repositories.List(ctx, "", nil)
if err != nil {
t.Errorf("Repositories.List returned error: %v", err)
}
Expand All @@ -39,15 +39,15 @@ func TestRepositoriesService_List_authenticatedUser(t *testing.T) {
}

// Test addOptions failure
got, resp, err = client.Repositories.List(ctx, "\n", &RepositoryListOptions{})
_, _, err = client.Repositories.List(ctx, "\n", &RepositoryListOptions{})
if err == nil {
t.Error("bad options List err = nil, want error")
}

// Test s.client.Do failure
client.BaseURL.Path = "/api-v3/"
client.rateLimits[0].Reset.Time = time.Now().Add(10 * time.Minute)
got, resp, err = client.Repositories.List(ctx, "", nil)
got, resp, err := client.Repositories.List(ctx, "", nil)
if got != nil {
t.Errorf("rate.Reset.Time > now List = %#v, want nil", got)
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestRepositoriesService_ListByOrg(t *testing.T) {

ctx := context.Background()
opt := &RepositoryListByOrgOptions{"forks", ListOptions{Page: 2}}
got, resp, err := client.Repositories.ListByOrg(ctx, "o", opt)
got, _, err := client.Repositories.ListByOrg(ctx, "o", opt)
if err != nil {
t.Errorf("Repositories.ListByOrg returned error: %v", err)
}
Expand All @@ -159,15 +159,15 @@ func TestRepositoriesService_ListByOrg(t *testing.T) {
}

// Test addOptions failure
got, resp, err = client.Repositories.ListByOrg(ctx, "\n", opt)
_, _, err = client.Repositories.ListByOrg(ctx, "\n", opt)
if err == nil {
t.Error("bad options ListByOrg err = nil, want error")
}

// Test s.client.Do failure
client.BaseURL.Path = "/api-v3/"
client.rateLimits[0].Reset.Time = time.Now().Add(10 * time.Minute)
got, resp, err = client.Repositories.ListByOrg(ctx, "o", opt)
got, resp, err := client.Repositories.ListByOrg(ctx, "o", opt)
if got != nil {
t.Errorf("rate.Reset.Time > now ListByOrg = %#v, want nil", got)
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func TestRepositoriesService_ListAll(t *testing.T) {

ctx := context.Background()
opt := &RepositoryListAllOptions{1}
got, resp, err := client.Repositories.ListAll(ctx, opt)
got, _, err := client.Repositories.ListAll(ctx, opt)
if err != nil {
t.Errorf("Repositories.ListAll returned error: %v", err)
}
Expand All @@ -213,7 +213,7 @@ func TestRepositoriesService_ListAll(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.ListAll(ctx, &RepositoryListAllOptions{1})
got, resp, err := client.Repositories.ListAll(ctx, &RepositoryListAllOptions{1})
if got != nil {
t.Errorf("client.BaseURL.Path='' ListAll = %#v, want nil", got)
}
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestRepositoriesService_Create_user(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.Create(ctx, "", input)
got, _, err := client.Repositories.Create(ctx, "", input)
if err != nil {
t.Errorf("Repositories.Create returned error: %v", err)
}
Expand All @@ -274,7 +274,7 @@ func TestRepositoriesService_Create_user(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.Create(ctx, "", input)
got, resp, err := client.Repositories.Create(ctx, "", input)
if got != nil {
t.Errorf("client.BaseURL.Path='' Create = %#v, want nil", got)
}
Expand Down Expand Up @@ -345,7 +345,7 @@ func TestRepositoriesService_Get(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.Get(ctx, "o", "r")
got, _, err := client.Repositories.Get(ctx, "o", "r")
if err != nil {
t.Errorf("Repositories.Get returned error: %v", err)
}
Expand All @@ -358,7 +358,7 @@ func TestRepositoriesService_Get(t *testing.T) {
// Test s.client.Do failure
client.BaseURL.Path = "/api-v3/"
client.rateLimits[0].Reset.Time = time.Now().Add(10 * time.Minute)
got, resp, err = client.Repositories.Get(ctx, "o", "r")
got, resp, err := client.Repositories.Get(ctx, "o", "r")
if got != nil {
t.Errorf("rate.Reset.Time > now Get = %#v, want nil", got)
}
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.GetCodeOfConduct(ctx, "o", "r")
got, _, err := client.Repositories.GetCodeOfConduct(ctx, "o", "r")
if err != nil {
t.Errorf("Repositories.GetCodeOfConduct returned error: %v", err)
}
Expand All @@ -404,7 +404,7 @@ func TestRepositoriesService_GetCodeOfConduct(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.GetCodeOfConduct(ctx, "o", "r")
got, resp, err := client.Repositories.GetCodeOfConduct(ctx, "o", "r")
if got != nil {
t.Errorf("client.BaseURL.Path='' GetCodeOfConduct = %#v, want nil", got)
}
Expand Down Expand Up @@ -440,7 +440,7 @@ func TestRepositoriesService_GetByID(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.GetByID(ctx, 1)
got, _, err := client.Repositories.GetByID(ctx, 1)
if err != nil {
t.Fatalf("Repositories.GetByID returned error: %v", err)
}
Expand All @@ -452,7 +452,7 @@ func TestRepositoriesService_GetByID(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.GetByID(ctx, 1)
got, resp, err := client.Repositories.GetByID(ctx, 1)
if got != nil {
t.Errorf("client.BaseURL.Path='' GetByID = %#v, want nil", got)
}
Expand Down Expand Up @@ -497,7 +497,7 @@ func TestRepositoriesService_Edit(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.Edit(ctx, "o", "r", input)
got, _, err := client.Repositories.Edit(ctx, "o", "r", input)
if err != nil {
t.Errorf("Repositories.Edit returned error: %v", err)
}
Expand All @@ -510,7 +510,7 @@ func TestRepositoriesService_Edit(t *testing.T) {
// Test s.client.Do failure
client.BaseURL.Path = "/api-v3/"
client.rateLimits[0].Reset.Time = time.Now().Add(10 * time.Minute)
got, resp, err = client.Repositories.Edit(ctx, "o", "r", input)
got, resp, err := client.Repositories.Edit(ctx, "o", "r", input)
if got != nil {
t.Errorf("rate.Reset.Time > now Edit = %#v, want nil", got)
}
Expand All @@ -531,14 +531,14 @@ func TestRepositoriesService_Delete(t *testing.T) {
})

ctx := context.Background()
resp, err := client.Repositories.Delete(ctx, "o", "r")
_, err := client.Repositories.Delete(ctx, "o", "r")
if err != nil {
t.Errorf("Repositories.Delete returned error: %v", err)
}

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
resp, err = client.Repositories.Delete(ctx, "o", "r")
resp, err := client.Repositories.Delete(ctx, "o", "r")
if resp != nil {
t.Errorf("client.BaseURL.Path='' Delete resp = %#v, want nil", resp)
}
Expand Down
20 changes: 10 additions & 10 deletions github/repos_traffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestRepositoriesService_ListTrafficReferrers(t *testing.T) {
}]`)
})
ctx := context.Background()
got, resp, err := client.Repositories.ListTrafficReferrers(ctx, "o", "r")
got, _, err := client.Repositories.ListTrafficReferrers(ctx, "o", "r")
if err != nil {
t.Errorf("Repositories.ListTrafficReferrers returned error: %+v", err)
}
Expand All @@ -43,7 +43,7 @@ func TestRepositoriesService_ListTrafficReferrers(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.ListTrafficReferrers(ctx, "o", "r")
got, resp, err := client.Repositories.ListTrafficReferrers(ctx, "o", "r")
if got != nil {
t.Errorf("client.BaseURL.Path='' ListTrafficReferrers = %#v, want nil", got)
}
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestRepositoriesService_ListTrafficPaths(t *testing.T) {
}]`)
})
ctx := context.Background()
got, resp, err := client.Repositories.ListTrafficPaths(ctx, "o", "r")
got, _, err := client.Repositories.ListTrafficPaths(ctx, "o", "r")
if err != nil {
t.Errorf("Repositories.ListTrafficPaths returned error: %+v", err)
}
Expand All @@ -100,7 +100,7 @@ func TestRepositoriesService_ListTrafficPaths(t *testing.T) {

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.ListTrafficPaths(ctx, "o", "r")
got, resp, err := client.Repositories.ListTrafficPaths(ctx, "o", "r")
if got != nil {
t.Errorf("client.BaseURL.Path='' ListTrafficPaths = %#v, want nil", got)
}
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.ListTrafficViews(ctx, "o", "r", nil)
got, _, err := client.Repositories.ListTrafficViews(ctx, "o", "r", nil)
if err != nil {
t.Errorf("Repositories.ListTrafficViews returned error: %+v", err)
}
Expand All @@ -162,14 +162,14 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) {
}

// Test addOptions failure
got, resp, err = client.Repositories.ListTrafficViews(ctx, "\n", "\n", &TrafficBreakdownOptions{})
_, _, err = client.Repositories.ListTrafficViews(ctx, "\n", "\n", &TrafficBreakdownOptions{})
if err == nil {
t.Error("bad options ListTrafficViews err = nil, want error")
}

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.ListTrafficViews(ctx, "o", "r", nil)
got, resp, err := client.Repositories.ListTrafficViews(ctx, "o", "r", nil)
if got != nil {
t.Errorf("client.BaseURL.Path='' ListTrafficViews = %#v, want nil", got)
}
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestRepositoriesService_ListTrafficClones(t *testing.T) {
})

ctx := context.Background()
got, resp, err := client.Repositories.ListTrafficClones(ctx, "o", "r", nil)
got, _, err := client.Repositories.ListTrafficClones(ctx, "o", "r", nil)
if err != nil {
t.Errorf("Repositories.ListTrafficClones returned error: %+v", err)
}
Expand All @@ -231,14 +231,14 @@ func TestRepositoriesService_ListTrafficClones(t *testing.T) {
}

// Test addOptions failure
got, resp, err = client.Repositories.ListTrafficClones(ctx, "\n", "\n", &TrafficBreakdownOptions{})
_, _, err = client.Repositories.ListTrafficClones(ctx, "\n", "\n", &TrafficBreakdownOptions{})
if err == nil {
t.Error("bad options ListTrafficViews err = nil, want error")
}

// Test s.client.NewRequest failure
client.BaseURL.Path = ""
got, resp, err = client.Repositories.ListTrafficClones(ctx, "o", "r", nil)
got, resp, err := client.Repositories.ListTrafficClones(ctx, "o", "r", nil)
if got != nil {
t.Errorf("client.BaseURL.Path='' ListTrafficClones = %#v, want nil", got)
}
Expand Down