From e7c56d8f50b5061b16f823fd5a6c195041837e79 Mon Sep 17 00:00:00 2001 From: 6543 <6543@noreply.gitea.io> Date: Wed, 27 May 2020 13:04:51 +0000 Subject: [PATCH] fix ineffassign in Tests & set Version v0.13.0 (#345) increment version fix ineffassign Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/345 Reviewed-by: Lunny Xiao Reviewed-by: Andrew Thornton --- gitea/client.go | 2 +- gitea/issue_comment_test.go | 1 + gitea/issue_milestone_test.go | 1 + gitea/org_member_test.go | 1 + gitea/pull_review_test.go | 2 ++ gitea/pull_test.go | 2 ++ 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gitea/client.go b/gitea/client.go index 207266d..ac8109d 100644 --- a/gitea/client.go +++ b/gitea/client.go @@ -22,7 +22,7 @@ var jsonHeader = http.Header{"content-type": []string{"application/json"}} // Version return the library version func Version() string { - return "0.12.0" + return "0.13.0" } // Client represents a Gitea API client. diff --git a/gitea/issue_comment_test.go b/gitea/issue_comment_test.go index e8731c0..6af4cfa 100644 --- a/gitea/issue_comment_test.go +++ b/gitea/issue_comment_test.go @@ -22,6 +22,7 @@ func TestIssueComment(t *testing.T) { repo, err := createTestRepo(t, "TestIssueCommentRepo", c) assert.NoError(t, err) issue1, err := c.CreateIssue(user.UserName, repo.Name, CreateIssueOption{Title: "issue1", Body: "body", Closed: false}) + assert.NoError(t, err) assert.EqualValues(t, 1, issue1.Index) issue2, err := c.CreateIssue(user.UserName, repo.Name, CreateIssueOption{Title: "issue1", Body: "body", Closed: false}) assert.EqualValues(t, 2, issue2.Index) diff --git a/gitea/issue_milestone_test.go b/gitea/issue_milestone_test.go index 3b0989a..1c721b9 100644 --- a/gitea/issue_milestone_test.go +++ b/gitea/issue_milestone_test.go @@ -53,5 +53,6 @@ func TestMilestones(t *testing.T) { _, err = c.GetMilestone(repo.Owner.UserName, repo.Name, m4.ID) assert.Error(t, err) m, err := c.GetMilestone(repo.Owner.UserName, repo.Name, m1.ID) + assert.NoError(t, err) assert.EqualValues(t, m1, m) } diff --git a/gitea/org_member_test.go b/gitea/org_member_test.go index 2563627..a148ff4 100644 --- a/gitea/org_member_test.go +++ b/gitea/org_member_test.go @@ -36,6 +36,7 @@ func TestOrgMembership(t *testing.T) { assert.True(t, check) err = c.SetPublicOrgMembership(newOrg.UserName, user.UserName, true) + assert.NoError(t, err) check, err = c.CheckPublicOrgMembership(newOrg.UserName, user.UserName) assert.NoError(t, err) assert.True(t, check) diff --git a/gitea/pull_review_test.go b/gitea/pull_review_test.go index 88b95ac..1af8419 100644 --- a/gitea/pull_review_test.go +++ b/gitea/pull_review_test.go @@ -58,6 +58,8 @@ func TestPullReview(t *testing.T) { }, }, }) + assert.NoError(t, err) + assert.NotNil(t, r3) // ListPullReviews c.SetSudo("") diff --git a/gitea/pull_test.go b/gitea/pull_test.go index ff3f3c8..76851c9 100644 --- a/gitea/pull_test.go +++ b/gitea/pull_test.go @@ -104,6 +104,8 @@ func TestPull(t *testing.T) { Title: "confl", State: &state, }) + assert.NoError(t, err) + assert.EqualValues(t, state, pr.State) pulls, err = c.ListRepoPullRequests(user.UserName, repoName, ListPullRequestsOptions{ State: StateClosed,