mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-06-04 18:23:59 +08:00
test: refactor plugin_test.go file and optimize code
- Remove the `TestSetPasswordAndKey` function from `plugin_test.go` Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -51,23 +51,6 @@ func TestMissingSourceConfig(t *testing.T) {
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestSetPasswordAndKey(t *testing.T) {
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
Host: []string{"example.com"},
|
||||
Username: "ubuntu",
|
||||
Port: "443",
|
||||
Password: "1234",
|
||||
Key: "test",
|
||||
},
|
||||
}
|
||||
|
||||
err := plugin.Exec()
|
||||
|
||||
assert.NotNil(t, err)
|
||||
assert.Equal(t, errSetPasswordandKey, err)
|
||||
}
|
||||
|
||||
func TestTrimElement(t *testing.T) {
|
||||
var input, result []string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user