refactor: show errors if set password and key at the same time (#72)

This commit is contained in:
Bo-Yi Wu
2017-04-23 11:49:40 +08:00
committed by GitHub
parent 4d8adbffca
commit b63f275e9e
2 changed files with 23 additions and 2 deletions
+16
View File
@@ -30,6 +30,22 @@ func TestMissingKeyOrPassword(t *testing.T) {
assert.Equal(t, missingPasswordOrKey, err.Error())
}
func TestSetPasswordAndKey(t *testing.T) {
plugin := Plugin{
Config{
Host: []string{"localhost"},
UserName: "ubuntu",
Password: "1234",
Key: "1234",
},
}
err := plugin.Exec()
assert.NotNil(t, err)
assert.Equal(t, setPasswordandKey, err.Error())
}
func TestIncorrectPassword(t *testing.T) {
plugin := Plugin{
Config: Config{