mirror of
https://github.com/rclone/rclone.git
synced 2025-04-16 16:18:52 +08:00
Merge 86edbed3284be1fe50358e0ccb9cbac978dc8b2d into 0b9671313b14ffe839ecbd7dd2ae5ac7f6f05db8
This commit is contained in:
commit
ff7697d55a
@ -75,6 +75,9 @@ See the [listremotes](/commands/rclone_listremotes/) command for more informatio
|
||||
// including any defined by environment variables.
|
||||
func rcListRemotes(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
remoteNames := GetRemoteNames()
|
||||
if remoteNames == nil {
|
||||
remoteNames = []string{}
|
||||
}
|
||||
out = rc.Params{
|
||||
"remotes": remoteNames,
|
||||
}
|
||||
|
@ -138,6 +138,22 @@ func TestRc(t *testing.T) {
|
||||
assert.Nil(t, out)
|
||||
assert.Equal(t, "", config.GetValue(testName, "type"))
|
||||
assert.Equal(t, "", config.GetValue(testName, "test_key"))
|
||||
|
||||
t.Run("ListRemotes empty not nil", func(t *testing.T) {
|
||||
call := rc.Calls.Get("config/listremotes")
|
||||
assert.NotNil(t, call)
|
||||
in := rc.Params{}
|
||||
out, err := call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, out)
|
||||
|
||||
var remotes []string
|
||||
err = out.GetStruct("remotes", &remotes)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.NotNil(t, remotes)
|
||||
assert.Empty(t, remotes)
|
||||
})
|
||||
}
|
||||
|
||||
func TestRcProviders(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user