test added

This commit is contained in:
Ivan Pedrazas
2017-06-03 15:47:08 +01:00
parent 24c0eec59c
commit 4fbed032da
+27
View File
@@ -169,6 +169,33 @@ func TestDetHelmInit(t *testing.T) {
}
}
func TestDetHelmInitClient(t *testing.T) {
plugin := &Plugin{
Config: Config{
HelmCommand: nil,
Namespace: "default",
SkipTLSVerify: true,
Debug: true,
DryRun: true,
Chart: "./chart/test",
Release: "test-release",
Prefix: "MY",
Values: "image.tag=$TAG,api=${API_SERVER},nameOverride=my-over-app,second.tag=${TAG}",
ClientOnly: true,
},
}
init := doHelmInit(plugin)
result := strings.Join(init, " ")
expected := "init "
if plugin.Config.ClientOnly {
expected = expected + "--client-only"
}
if expected != result {
t.Error("Helm cannot init in client only")
}
}
func TestResolveSecretsFallback(t *testing.T) {
tag := "v0.1.1"
api := "http://apiserver"