mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 09:33:36 +00:00
vfs: fix vfs/refresh calls with fs= parameter
Before this change rclone gave an error when the fs parameter was provided. This change removes the fs parameter from the parameters once it has been read which avoids the error. See: https://forum.rclone.org/t/precaching-with-vfs-refresh-fails-with-an-error-when-having-multiple-cloud-drives/20267
This commit is contained in:
@@ -57,6 +57,7 @@ func TestRcGetVFS(t *testing.T) {
|
||||
assert.Contains(t, err.Error(), "more than one VFS active - need")
|
||||
assert.Nil(t, vfs)
|
||||
|
||||
inPresent = rc.Params{"fs": fs.ConfigString(r.Fremote)}
|
||||
vfs, err = getVFS(inPresent)
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "more than one VFS active with name")
|
||||
@@ -67,7 +68,8 @@ func TestRcForget(t *testing.T) {
|
||||
r, vfs, cleanup, call := rcNewRun(t, "vfs/forget")
|
||||
defer cleanup()
|
||||
_, _ = r, vfs
|
||||
out, err := call.Fn(context.Background(), nil)
|
||||
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
|
||||
out, err := call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, rc.Params{
|
||||
"forgotten": []string{},
|
||||
@@ -79,7 +81,8 @@ func TestRcRefresh(t *testing.T) {
|
||||
r, vfs, cleanup, call := rcNewRun(t, "vfs/refresh")
|
||||
defer cleanup()
|
||||
_, _ = r, vfs
|
||||
out, err := call.Fn(context.Background(), nil)
|
||||
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
|
||||
out, err := call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, rc.Params{
|
||||
"result": map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user