Test case to reject bad command.
(t *testing.T)
| 159 | |
| 160 | // Test case to reject bad command. |
| 161 | func 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. |
| 175 | func TestRejectCommAPIHostNotSet(t *testing.T) { |
nothing calls this directly
no test coverage detected