woodpecker/vendor/github.com/Bugagazavr/go-gitlab-client/gitlab_test.go

14 lines
438 B
Go
Raw Normal View History

2015-07-26 23:25:20 +00:00
package gogitlab
import (
2015-09-30 01:21:17 +00:00
"github.com/stretchr/testify/assert"
2015-07-26 23:25:20 +00:00
"testing"
)
func TestResourceUrl(t *testing.T) {
gitlab := NewGitlab("http://base_url/", "api_path", "token")
assert.Equal(t, gitlab.ResourceUrl(projects_url, nil), "http://base_url/api_path/projects?private_token=token")
assert.Equal(t, gitlab.ResourceUrl(project_url, map[string]string{":id": "123"}), "http://base_url/api_path/projects/123?private_token=token")
}