chore: add more tests (#2800)

master
Kevin Wan 2 years ago committed by GitHub
parent 2bfecf9354
commit 4bed34090f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,11 @@
package internal
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestEtcdBuilder_Scheme(t *testing.T) {
assert.Equal(t, EtcdScheme, new(etcdBuilder).Scheme())
}

@ -1,12 +1,25 @@
package internal package internal
import ( import (
"fmt"
"net/url"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"google.golang.org/grpc/resolver"
) )
func TestKubeBuilder_Scheme(t *testing.T) { func TestKubeBuilder_Scheme(t *testing.T) {
var b kubeBuilder var b kubeBuilder
assert.Equal(t, KubernetesScheme, b.Scheme()) assert.Equal(t, KubernetesScheme, b.Scheme())
} }
func TestKubeBuilder_Build(t *testing.T) {
var b kubeBuilder
u, err := url.Parse(fmt.Sprintf("%s://%s", KubernetesScheme, "a,b"))
assert.NoError(t, err)
_, err = b.Build(resolver.Target{
URL: *u,
}, nil, resolver.BuildOptions{})
assert.Error(t, err)
}

Loading…
Cancel
Save