update deps and simplify some code

This commit is contained in:
Nicola Murino
2020-01-31 23:26:56 +01:00
parent e647f3626e
commit 31a433cda2
6 changed files with 100 additions and 55 deletions

View File

@@ -147,6 +147,21 @@ func TestWrongActions(t *testing.T) {
actions = actionsCopy
}
func TestActionHTTP(t *testing.T) {
actionsCopy := actions
actions = Actions{
ExecuteOn: []string{operationDownload},
Command: "",
HTTPNotificationURL: "http://127.0.0.1:8080/",
}
err := executeAction(operationDownload, "username", "path", "", "", 0, true)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
actions = actionsCopy
}
func TestRemoveNonexistentTransfer(t *testing.T) {
transfer := Transfer{}
err := removeTransfer(&transfer)