mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
rc: config/unlock: rename parameter to configPassword accept old as well
We accidentally added a non `camelCase` parameter to the rc (`config_password`)- this fixes it (to `configPassword`) but accepts the old name too as it has been in a release.
This commit is contained in:
@@ -215,13 +215,26 @@ func TestRcPaths(t *testing.T) {
|
||||
func TestRcConfigUnlock(t *testing.T) {
|
||||
call := rc.Calls.Get("config/unlock")
|
||||
assert.NotNil(t, call)
|
||||
|
||||
in := rc.Params{
|
||||
"config_password": "test",
|
||||
"configPassword": "test",
|
||||
}
|
||||
out, err := call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Nil(t, out)
|
||||
|
||||
in = rc.Params{
|
||||
"config_password": "test",
|
||||
}
|
||||
out, err = call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
assert.Nil(t, out)
|
||||
|
||||
in = rc.Params{
|
||||
"bad_config_password": "test",
|
||||
}
|
||||
out, err = call.Fn(context.Background(), in)
|
||||
require.Error(t, err)
|
||||
assert.ErrorContains(t, err, `Didn't find key "configPassword" in input`)
|
||||
assert.Nil(t, out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user