MCPcopy Create free account
hub / github.com/devspace-sh/devspace / TestSetFlag

Function TestSetFlag

pkg/util/strvals/strvals_test.go:28–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestSetFlag(t *testing.T) {
29 s := "deployments.dev.helm.values.containers[1].image="
30 rawConfig := getActualRawConfig()
31 err := ParseInto(s, rawConfig)
32 if err != nil {
33 fmt.Println(errors.Wrap(err, "parsing --set flag"))
34 log.Fatal(err)
35 }
36 b, err := json.Marshal(rawConfig)
37 if err != nil {
38 fmt.Println(err)
39 }
40 fmt.Println("output : " + string(b))
41 assert.DeepEqual(t, rawConfig, getExpectedRawConfigForSet())
42}
43
44func getExpectedRawConfigForSet() map[string]interface{} {
45 jsonStr := "{\"deployments\":{\"dev\":{\"helm\":{\"values\":{\"containers\":[{\"image\":\"alpine\"},{\"image\":null}]}}}},\"name\":\"run-pipelines-demo\",\"pipelines\":{\"deploy\":\"create_deployments --all\",\"dev\":\"run_pipelines deploy --set deployments.dev.helm.values.containers[0].image=nginx --set-string deployments.dev.helm.values.containers[0].name=mynginx\"},\"version\":\"v2beta1\"}"

Callers

nothing calls this directly

Calls 4

getActualRawConfigFunction · 0.85
ParseIntoFunction · 0.85
FatalMethod · 0.45

Tested by

no test coverage detected