2019-06-04 13:04:18 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-08-27 11:01:29 +00:00
|
|
|
"github.com/laszlocph/woodpecker/model"
|
|
|
|
"github.com/laszlocph/woodpecker/remote/github"
|
2019-06-04 13:04:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFetchGithub(t *testing.T) {
|
2019-10-06 18:30:06 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
2019-06-04 13:04:18 +00:00
|
|
|
github, err := github.New(github.Opts{URL: "https://github.com"})
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
configFetcher := &configFetcher{
|
|
|
|
remote_: github,
|
|
|
|
user: &model.User{Token: "xxx"},
|
|
|
|
repo: &model.Repo{Owner: "laszlocph", Name: "drone-multipipeline", Config: ".drone"},
|
|
|
|
build: &model.Build{Commit: "89ab7b2d6bfb347144ac7c557e638ab402848fee"},
|
|
|
|
}
|
|
|
|
configFetcher.Fetch()
|
|
|
|
}
|