config: reset environment variables in config file test to fix build

This commit is contained in:
Nick Craig-Wood 2019-06-22 17:25:12 +01:00
parent 4ee6de5c3e
commit 0ae844d1f8

View File

@ -16,6 +16,8 @@ import (
func testConfigFile(t *testing.T, configFileName string) func() {
configKey = nil // reset password
_ = os.Unsetenv("_RCLONE_CONFIG_KEY_FILE")
_ = os.Unsetenv("RCLONE_CONFIG_PASS")
// create temp config file
tempFile, err := ioutil.TempFile("", configFileName)
assert.NoError(t, err)
@ -63,6 +65,9 @@ func testConfigFile(t *testing.T, configFileName string) func() {
ReadLine = oldReadLine
fs.Config = oldConfig
configFile = oldConfigFile
_ = os.Unsetenv("_RCLONE_CONFIG_KEY_FILE")
_ = os.Unsetenv("RCLONE_CONFIG_PASS")
}
}