rc: added command core/quit

This commit is contained in:
Saksham Khanna
2019-10-17 19:34:22 +05:30
committed by Nick Craig-Wood
parent 9cb549a227
commit 0c265713fd
2 changed files with 50 additions and 2 deletions

View File

@@ -5,11 +5,12 @@ import (
"runtime"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config/obscure"
"github.com/rclone/rclone/fs/version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestInternalNoop(t *testing.T) {
@@ -107,3 +108,14 @@ func TestCoreObscure(t *testing.T) {
require.NotNil(t, out)
assert.Equal(t, in["clear"], obscure.MustReveal(out["obscured"].(string)))
}
func TestCoreQuit(t *testing.T) {
//The call should return an error if param exitCode is not parsed to int
call := Calls.Get("core/quit")
assert.NotNil(t, call)
in := Params{
"exitCode": "potato",
}
_, err := call.Fn(context.Background(), in)
require.Error(t, err)
}