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

Function TestSetMultipleValues

tests/src/integration/command_test.go:143–158  ·  view source on GitHub ↗

Test case to set multiple property values with single command.

(t *testing.T)

Source from the content-addressed store, hash-verified

141
142// Test case to set multiple property values with single command.
143func TestSetMultipleValues(t *testing.T) {
144 common.CreateFile(tmpProp)
145
146 os.Setenv("WSK_CONFIG_FILE", tmpProp)
147 assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.")
148
149 _, err := wsk.RunCommand("property", "set", "--auth", "testKey", "--apihost", "openwhisk.ng.bluemix.net",
150 "--apiversion", "v1")
151 assert.Equal(t, nil, err, "The command property set --auth --apihost --apiversion failed to run.")
152 output := common.ReadFile(tmpProp)
153 assert.Contains(t, output, "AUTH=testKey", "The wsk property file does not contain \"AUTH=testKey\".")
154 assert.Contains(t, output, "APIHOST=openwhisk.ng.bluemix.net",
155 "The wsk property file does not contain \"APIHOST=openwhisk.ng.bluemix.net\".")
156 assert.Contains(t, output, "APIVERSION=v1", "The wsk property file does not contain \"APIVERSION=v1\".")
157 common.DeleteFile(tmpProp)
158}
159
160// Test case to reject bad command.
161func TestRejectBadComm(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