1
0
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:
Nick Craig-Wood
2025-08-13 15:26:07 +01:00
parent 8d353039a6
commit 8d878d0a5f

View File

@@ -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")