config: reset environment variables in config file test to fix build
This commit is contained in:
parent
4ee6de5c3e
commit
0ae844d1f8
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,8 @@ import (
|
||||||
|
|
||||||
func testConfigFile(t *testing.T, configFileName string) func() {
|
func testConfigFile(t *testing.T, configFileName string) func() {
|
||||||
configKey = nil // reset password
|
configKey = nil // reset password
|
||||||
|
_ = os.Unsetenv("_RCLONE_CONFIG_KEY_FILE")
|
||||||
|
_ = os.Unsetenv("RCLONE_CONFIG_PASS")
|
||||||
// create temp config file
|
// create temp config file
|
||||||
tempFile, err := ioutil.TempFile("", configFileName)
|
tempFile, err := ioutil.TempFile("", configFileName)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
@ -63,6 +65,9 @@ func testConfigFile(t *testing.T, configFileName string) func() {
|
||||||
ReadLine = oldReadLine
|
ReadLine = oldReadLine
|
||||||
fs.Config = oldConfig
|
fs.Config = oldConfig
|
||||||
configFile = oldConfigFile
|
configFile = oldConfigFile
|
||||||
|
|
||||||
|
_ = os.Unsetenv("_RCLONE_CONFIG_KEY_FILE")
|
||||||
|
_ = os.Unsetenv("RCLONE_CONFIG_PASS")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue