mirror of
https://github.com/rclone/rclone.git
synced 2025-11-29 05:47:23 +02:00
config: fix test failure on local machine with a config file
This uses a temporary config file instead.
This commit is contained in:
@@ -3,6 +3,7 @@ package config_test
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
_ "github.com/rclone/rclone/backend/local"
|
||||
@@ -19,6 +20,12 @@ const testName = "configTestNameForRc"
|
||||
|
||||
func TestRc(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
oldConfigFile := config.GetConfigPath()
|
||||
defer func() {
|
||||
require.NoError(t, config.SetConfigPath(oldConfigFile))
|
||||
}()
|
||||
// Set a temporary config file
|
||||
require.NoError(t, config.SetConfigPath(filepath.Join(t.TempDir(), "rclone.conf")))
|
||||
configfile.Install()
|
||||
// Create the test remote
|
||||
call := rc.Calls.Get("config/create")
|
||||
|
||||
Reference in New Issue
Block a user