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:
@@ -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 := ®InfoValues{
|
||||
fsInfo: fsInfo,
|
||||
options: testOptions,
|
||||
useDefault: false,
|
||||
}
|
||||
regInfoValuesGetterTrue := ®InfoValues{
|
||||
fsInfo: fsInfo,
|
||||
options: testOptions,
|
||||
useDefault: true,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user