Add support for enterprise repos to github plugin (#6194)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package github
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -8,6 +9,18 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNewGithubClient(t *testing.T) {
|
||||
httpClient := &http.Client{}
|
||||
g := &GitHub{}
|
||||
client, err := g.newGithubClient(httpClient)
|
||||
require.Nil(t, err)
|
||||
require.Contains(t, client.BaseURL.String(), "api.github.com")
|
||||
g.EnterpriseBaseURL = "api.example.com/"
|
||||
enterpriseClient, err := g.newGithubClient(httpClient)
|
||||
require.Nil(t, err)
|
||||
require.Contains(t, enterpriseClient.BaseURL.String(), "api.example.com")
|
||||
}
|
||||
|
||||
func TestSplitRepositoryNameWithWorkingExample(t *testing.T) {
|
||||
var validRepositoryNames = []struct {
|
||||
fullName string
|
||||
|
||||
Reference in New Issue
Block a user