Created
June 17, 2018 14:26
-
-
Save feloy/c2784dd33b6dbeb1f483a391a04e893f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"testing" | |
"k8s.io/client-go/kubernetes/fake" | |
) | |
func newTestSimpleK8s() *k8s { | |
client := k8s{} | |
client.clientset = fake.NewSimpleClientset() | |
return &client | |
} | |
func TestGetVersionDefault(t *testing.T) { | |
k8s := newTestSimpleK8s() | |
v, err := k8s.getVersion() | |
if err != nil { | |
t.Fatal("getVersion should not raise an error") | |
} | |
expected := "v0.0.0-master+$Format:%h$" | |
if v != expected { | |
t.Fatal("getVersion should return " + expected) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment