From 4fbed032da8f6245841f8a2fe10fd1546be2de14 Mon Sep 17 00:00:00 2001 From: Ivan Pedrazas Date: Sat, 3 Jun 2017 15:47:08 +0100 Subject: [PATCH] test added --- plugin_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/plugin_test.go b/plugin_test.go index 8b17f88..c4a61ae 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -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"