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

Function TestRejectBadComm

tests/src/integration/command_test.go:161–172  ·  view source on GitHub ↗

Test case to reject bad command.

(t *testing.T)

Source from the content-addressed store, hash-verified

159
160// Test case to reject bad command.
161func TestRejectBadComm(t *testing.T) {
162 common.CreateFile(tmpProp)
163
164 os.Setenv("WSK_CONFIG_FILE", tmpProp)
165 assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.")
166
167 stdout, err := wsk.RunCommand("bogus")
168 assert.NotEqual(t, nil, err, "The command bogus should fail to run.")
169 assert.Contains(t, string(stdout), "Run 'wsk --help' for usage",
170 "The output of the command does not contain \"Run 'wsk --help' for usage\".")
171 common.DeleteFile(tmpProp)
172}
173
174// Test case to reject a command when the API host is not set.
175func TestRejectCommAPIHostNotSet(t *testing.T) {

Callers

nothing calls this directly

Calls 3

CreateFileFunction · 0.92
DeleteFileFunction · 0.92
RunCommandMethod · 0.80

Tested by

no test coverage detected