Add Pagination Options for List Requests #205

Merged
lunny merged 36 commits from spawn2kill/go-sdk:pagination into master 2020-02-05 08:00:00 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 51b18b927e - Show all commits

View File

@ -51,12 +51,12 @@ func TestIssueComment(t *testing.T) {
assert.NoError(t, c.AdminDeleteUser(tUser3.UserName))
// ListRepoIssueComments
comments, err := c.ListRepoIssueComments(user.UserName, repo.Name)
comments, err := c.ListRepoIssueComments(user.UserName, repo.Name, ListRepoIssueCommentsOptions{})
assert.NoError(t, err)
assert.Len(t, comments, 7)
// ListIssueComments
comments, err = c.ListIssueComments(user.UserName, repo.Name, 2)
comments, err = c.ListIssueComments(user.UserName, repo.Name, 2, ListIssueCommentsOptions{})
assert.NoError(t, err)
assert.Len(t, comments, 3)

View File

@ -29,7 +29,7 @@ func TestUserApp(t *testing.T) {
log.Println("== TestUserApp ==")
c := newTestClient()
result, err := c.ListAccessTokens(c.username, c.password)
result, err := c.ListAccessTokens(c.username, c.password, ListAccessTokens{})
assert.NoError(t, err)
assert.Len(t, result, 1)
assert.EqualValues(t, "gitea-admin", result[0].Name)
@ -37,12 +37,12 @@ func TestUserApp(t *testing.T) {
t1, err := c.CreateAccessToken(c.username, c.password, CreateAccessTokenOption{Name: "TestCreateAccessToken"})
assert.NoError(t, err)
assert.EqualValues(t, "TestCreateAccessToken", t1.Name)
result, _ = c.ListAccessTokens(c.username, c.password)
result, _ = c.ListAccessTokens(c.username, c.password, ListAccessTokens{})
assert.Len(t, result, 2)
err = c.DeleteAccessToken(c.username, c.password, t1.ID)
assert.NoError(t, err)
result, _ = c.ListAccessTokens(c.username, c.password)
result, _ = c.ListAccessTokens(c.username, c.password, ListAccessTokens{})
assert.Len(t, result, 1)
}