30 lines
535 B
Go
30 lines
535 B
Go
|
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)
|
||
|
}
|
||
|
}
|