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

Function TestSetAuth

tests/src/integration/command_test.go:128–140  ·  view source on GitHub ↗

Test case to set auth in property file.

(t *testing.T)

Source from the content-addressed store, hash-verified

126
127// Test case to set auth in property file.
128func TestSetAuth(t *testing.T) {
129 common.CreateFile(tmpProp)
130
131 os.Setenv("WSK_CONFIG_FILE", tmpProp)
132 assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.")
133
134 _, err := wsk.RunCommand("property", "set", "--auth", "testKey")
135 assert.Equal(t, nil, err, "The command property set --auth testKey failed to run.")
136 output := common.ReadFile(tmpProp)
137 assert.Contains(t, output, "AUTH=testKey",
138 "The wsk property file does not contain \"AUTH=testKey\".")
139 common.DeleteFile(tmpProp)
140}
141
142// Test case to set multiple property values with single command.
143func TestSetMultipleValues(t *testing.T) {

Callers

nothing calls this directly

Calls 4

CreateFileFunction · 0.92
ReadFileFunction · 0.92
DeleteFileFunction · 0.92
RunCommandMethod · 0.80

Tested by

no test coverage detected