mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
config create: add --non-interactive and --continue parameters #3455
This adds a mechanism to add external interfaces to rclone using the state based configuration.
This commit is contained in:
@@ -197,10 +197,15 @@ func TestCreateUpdatePasswordRemote(t *testing.T) {
|
||||
break
|
||||
}
|
||||
t.Run(fmt.Sprintf("doObscure=%v,noObscure=%v", doObscure, noObscure), func(t *testing.T) {
|
||||
require.NoError(t, config.CreateRemote(ctx, "test2", "config_test_remote", rc.Params{
|
||||
opt := config.UpdateRemoteOpt{
|
||||
Obscure: doObscure,
|
||||
NoObscure: noObscure,
|
||||
}
|
||||
_, err := config.CreateRemote(ctx, "test2", "config_test_remote", rc.Params{
|
||||
"bool": true,
|
||||
"pass": "potato",
|
||||
}, doObscure, noObscure))
|
||||
}, opt)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, []string{"test2"}, config.Data().GetSectionList())
|
||||
assert.Equal(t, "config_test_remote", config.FileGet("test2", "type"))
|
||||
@@ -212,11 +217,12 @@ func TestCreateUpdatePasswordRemote(t *testing.T) {
|
||||
assert.Equal(t, "potato", gotPw)
|
||||
|
||||
wantPw := obscure.MustObscure("potato2")
|
||||
require.NoError(t, config.UpdateRemote(ctx, "test2", rc.Params{
|
||||
_, err = config.UpdateRemote(ctx, "test2", rc.Params{
|
||||
"bool": false,
|
||||
"pass": wantPw,
|
||||
"spare": "spare",
|
||||
}, doObscure, noObscure))
|
||||
}, opt)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, []string{"test2"}, config.Data().GetSectionList())
|
||||
assert.Equal(t, "config_test_remote", config.FileGet("test2", "type"))
|
||||
|
||||
Reference in New Issue
Block a user