1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

fs: refactor fs.ConfigMap to take a prefix and Options rather than an fs.RegInfo

This is in preparation for generalising the backend config system
This commit is contained in:
Nick Craig-Wood
2024-07-01 18:06:49 +01:00
parent 6e853c82d8
commit 8d72698d5a
7 changed files with 31 additions and 32 deletions

View File

@@ -314,12 +314,6 @@ func TestOptionGetters(t *testing.T) {
}
}()
fsInfo := &RegInfo{
Name: "local",
Prefix: "local",
Options: testOptions,
}
oldConfigFileGet := ConfigFileGet
ConfigFileGet = func(section, key string) (string, bool) {
if section == "sausage" && key == "key1" {
@@ -337,16 +331,16 @@ func TestOptionGetters(t *testing.T) {
configEnvVarsGetter := configEnvVars("local")
// A configmap.Getter to read from the environment RCLONE_option_name
optionEnvVarsGetter := optionEnvVars{fsInfo}
optionEnvVarsGetter := optionEnvVars{"local", testOptions}
// A configmap.Getter to read either the default value or the set
// value from the RegInfo.Options
regInfoValuesGetterFalse := &regInfoValues{
fsInfo: fsInfo,
options: testOptions,
useDefault: false,
}
regInfoValuesGetterTrue := &regInfoValues{
fsInfo: fsInfo,
options: testOptions,
useDefault: true,
}