mirror of
https://gitea.com/gitea/go-sdk.git
synced 2024-06-02 02:01:25 +05:30
7eef2b536f
CI.restart() fix test Fix MergePullRequest & extend Tests (#278) rm MergePullRequestResponse Fix MergePullRequest Extend Tests Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/278 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/316 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
35 lines
738 B
Go
35 lines
738 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package gitea
|
|
|
|
import (
|
|
"log"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPull(t *testing.T) {
|
|
log.Println("== TestPull ==")
|
|
c := newTestClient()
|
|
user, err := c.GetMyUserInfo()
|
|
assert.NoError(t, err)
|
|
|
|
var repoName = "repo_pull_test"
|
|
_, err = createTestRepo(t, repoName, c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
// ListRepoPullRequests list PRs of one repository
|
|
pulls, err := c.ListRepoPullRequests(user.UserName, repoName, ListPullRequestsOptions{
|
|
Page: 1,
|
|
State: "all",
|
|
Sort: "leastupdate",
|
|
})
|
|
assert.NoError(t, err)
|
|
assert.Len(t, pulls, 0)
|
|
}
|