Test case to validate default property values.
(t *testing.T)
| 96 | |
| 97 | // Test case to validate default property values. |
| 98 | func TestValidateDefaultProperties(t *testing.T) { |
| 99 | common.CreateFile(tmpProp) |
| 100 | |
| 101 | os.Setenv("WSK_CONFIG_FILE", tmpProp) |
| 102 | assert.Equal(t, os.Getenv("WSK_CONFIG_FILE"), tmpProp, "The environment variable WSK_CONFIG_FILE has not been set.") |
| 103 | |
| 104 | stdout, err := wsk.RunCommand("property", "unset", "--auth", "--apihost", "--apiversion") |
| 105 | assert.Equal(t, nil, err, "The command property unset failed to run.") |
| 106 | outputString := string(stdout) |
| 107 | assert.Contains(t, outputString, "ok: whisk auth unset", |
| 108 | "The output of the command does not contain \"ok: whisk auth unset\".") |
| 109 | assert.Contains(t, outputString, "ok: whisk API host unset", |
| 110 | "The output of the command does not contain \"ok: whisk API host unset\".") |
| 111 | assert.Contains(t, outputString, "ok: whisk API version unset", |
| 112 | "The output of the command does not contain \"ok: whisk API version unset\".") |
| 113 | |
| 114 | stdout, err = wsk.RunCommand("property", "get", "--auth") |
| 115 | assert.Equal(t, nil, err, "The command property get --auth failed to run.") |
| 116 | assert.Equal(t, common.PropDisplayAuth, common.RemoveRedundantSpaces(string(stdout)), |
| 117 | "The output of the command does not equal to "+common.PropDisplayAuth) |
| 118 | |
| 119 | stdout, err = wsk.RunCommand("property", "get", "--apihost") |
| 120 | assert.Equal(t, nil, err, "The command property get --apihost failed to run.") |
| 121 | assert.Equal(t, common.PropDisplayAPIHost, common.RemoveRedundantSpaces(string(stdout)), |
| 122 | "The output of the command does not equal to "+common.PropDisplayAPIHost) |
| 123 | |
| 124 | common.DeleteFile(tmpProp) |
| 125 | } |
| 126 | |
| 127 | // Test case to set auth in property file. |
| 128 | func TestSetAuth(t *testing.T) { |
nothing calls this directly
no test coverage detected