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 <xiaolunwen@gmail.com> Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
567d2f8bbd
commit
e7c56d8f50
6 changed files with 8 additions and 1 deletions
|
@ -22,7 +22,7 @@ var jsonHeader = http.Header{"content-type": []string{"application/json"}}
|
||||||
|
|
||||||
// Version return the library version
|
// Version return the library version
|
||||||
func Version() string {
|
func Version() string {
|
||||||
return "0.12.0"
|
return "0.13.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client represents a Gitea API client.
|
// Client represents a Gitea API client.
|
||||||
|
|
|
@ -22,6 +22,7 @@ func TestIssueComment(t *testing.T) {
|
||||||
repo, err := createTestRepo(t, "TestIssueCommentRepo", c)
|
repo, err := createTestRepo(t, "TestIssueCommentRepo", c)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
issue1, err := c.CreateIssue(user.UserName, repo.Name, CreateIssueOption{Title: "issue1", Body: "body", Closed: false})
|
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)
|
assert.EqualValues(t, 1, issue1.Index)
|
||||||
issue2, err := c.CreateIssue(user.UserName, repo.Name, CreateIssueOption{Title: "issue1", Body: "body", Closed: false})
|
issue2, err := c.CreateIssue(user.UserName, repo.Name, CreateIssueOption{Title: "issue1", Body: "body", Closed: false})
|
||||||
assert.EqualValues(t, 2, issue2.Index)
|
assert.EqualValues(t, 2, issue2.Index)
|
||||||
|
|
|
@ -53,5 +53,6 @@ func TestMilestones(t *testing.T) {
|
||||||
_, err = c.GetMilestone(repo.Owner.UserName, repo.Name, m4.ID)
|
_, err = c.GetMilestone(repo.Owner.UserName, repo.Name, m4.ID)
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
m, err := c.GetMilestone(repo.Owner.UserName, repo.Name, m1.ID)
|
m, err := c.GetMilestone(repo.Owner.UserName, repo.Name, m1.ID)
|
||||||
|
assert.NoError(t, err)
|
||||||
assert.EqualValues(t, m1, m)
|
assert.EqualValues(t, m1, m)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ func TestOrgMembership(t *testing.T) {
|
||||||
assert.True(t, check)
|
assert.True(t, check)
|
||||||
|
|
||||||
err = c.SetPublicOrgMembership(newOrg.UserName, user.UserName, true)
|
err = c.SetPublicOrgMembership(newOrg.UserName, user.UserName, true)
|
||||||
|
assert.NoError(t, err)
|
||||||
check, err = c.CheckPublicOrgMembership(newOrg.UserName, user.UserName)
|
check, err = c.CheckPublicOrgMembership(newOrg.UserName, user.UserName)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.True(t, check)
|
assert.True(t, check)
|
||||||
|
|
|
@ -58,6 +58,8 @@ func TestPullReview(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.NotNil(t, r3)
|
||||||
|
|
||||||
// ListPullReviews
|
// ListPullReviews
|
||||||
c.SetSudo("")
|
c.SetSudo("")
|
||||||
|
|
|
@ -104,6 +104,8 @@ func TestPull(t *testing.T) {
|
||||||
Title: "confl",
|
Title: "confl",
|
||||||
State: &state,
|
State: &state,
|
||||||
})
|
})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.EqualValues(t, state, pr.State)
|
||||||
|
|
||||||
pulls, err = c.ListRepoPullRequests(user.UserName, repoName, ListPullRequestsOptions{
|
pulls, err = c.ListRepoPullRequests(user.UserName, repoName, ListPullRequestsOptions{
|
||||||
State: StateClosed,
|
State: StateClosed,
|
||||||
|
|
Loading…
Reference in a new issue