mirror of https://github.com/knative/func.git
25 lines
544 B
Go
25 lines
544 B
Go
package k8s_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"knative.dev/func/k8s"
|
|
)
|
|
|
|
func TestListSecretsNamesIfConnectedWrongKubeconfig(t *testing.T) {
|
|
t.Setenv("KUBECONFIG", "/tmp/non-existent.config")
|
|
_, err := k8s.ListSecretsNamesIfConnected(context.Background(), "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestListSecretsNamesIfConnectedWrongKubernentesMaster(t *testing.T) {
|
|
t.Setenv("KUBERNETES_MASTER", "/tmp/non-existent.config")
|
|
_, err := k8s.ListSecretsNamesIfConnected(context.Background(), "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|