agola/internal/gitsources/gitlab/gitlab_test.go

30 lines
535 B
Go
Raw Normal View History

2022-03-04 05:32:45 +00:00
package gitlab
import (
"testing"
gitlab "github.com/xanzy/go-gitlab"
)
var c *Client
func init() {
c, _ = New(Opts{SkipVerify: true, APIURL: "https://gitlab.com"})
}
func TestListUserReposLimit(t *testing.T) {
baseOpts := gitlab.ListProjectsOptions{
ListOptions: gitlab.ListOptions{
Page: 1,
PerPage: 1,
},
}
repos, err := c.listUserRepos(baseOpts)
if err != nil {
t.Errorf("err getting repos %v", err)
}
if len(repos) != PAGE_MAX {
t.Errorf("page fail expected %d to be %d", len(repos), PAGE_MAX)
}
}