From 8d878d0a5fe1267dcfb55cd9589b450fdfcc193c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 13 Aug 2025 15:26:07 +0100 Subject: [PATCH] config: fix test failure on local machine with a config file This uses a temporary config file instead. --- fs/config/rc_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/config/rc_test.go b/fs/config/rc_test.go index b21b8af50..682a8fe71 100644 --- a/fs/config/rc_test.go +++ b/fs/config/rc_test.go @@ -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")