MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / TestDefaultNamespace

Function TestDefaultNamespace

tests/src/integration/command_test.go:83–95  ·  view source on GitHub ↗

Test case to verify the default namespace _.

(t *testing.T)

Source from the content-addressed store, hash-verified

81
82// Test case to verify the default namespace _.
83func TestDefaultNamespace(t *testing.T) {
84 common.CreateFile(tmpProp)
85 common.WriteFile(tmpProp, []string{"APIHOST=xyz"})
86
87 os.Setenv("WSK_CONFIG_FILE", tmpProp)
88 assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.")
89
90 stdout, err := wsk.RunCommand("property", "get", "-i", "--namespace")
91 assert.Equal(t, nil, err, "The command property get -i --namespace failed to run.")
92 assert.Contains(t, common.RemoveRedundantSpaces(string(stdout)), common.PropDisplayNamespace+" _",
93 "The output of the command does not contain "+common.PropDisplayCLIVersion+" _")
94 common.DeleteFile(tmpProp)
95}
96
97// Test case to validate default property values.
98func TestValidateDefaultProperties(t *testing.T) {

Callers

nothing calls this directly

Calls 5

CreateFileFunction · 0.92
WriteFileFunction · 0.92
RemoveRedundantSpacesFunction · 0.92
DeleteFileFunction · 0.92
RunCommandMethod · 0.80

Tested by

no test coverage detected