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

Function TestRejectAuthCommNoKey

tests/src/integration/integration_test.go:416–430  ·  view source on GitHub ↗

Test case to reject bad command.

(t *testing.T)

Source from the content-addressed store, hash-verified

414
415// Test case to reject bad command.
416func TestRejectAuthCommNoKey(t *testing.T) {
417 common.CreateFile(tmpProp)
418
419 os.Setenv("WSK_CONFIG_FILE", tmpProp)
420 assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.")
421
422 stdout, err := wsk.RunCommand("list", "--apihost", wsk.Wskprops.APIHost,
423 "--apiversion", wsk.Wskprops.Apiversion)
424 assert.NotEqual(t, nil, err, "The command list should fail to run.")
425 assert.Contains(t, common.RemoveRedundantSpaces(string(stdout)), "usage.",
426 "The output of the command does not contain \"usage.\".")
427 assert.Contains(t, common.RemoveRedundantSpaces(string(stdout)), "--auth is required",
428 "The output of the command does not contain \"--auth is required\".")
429 common.DeleteFile(tmpProp)
430}
431
432// Test case to reject commands that are executed with invalid arguments.
433func TestRejectCommInvalidArgs(t *testing.T) {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected