protondrive: restore rclone's config storage after the password test
TestPasswordStoredObscured installed the config file storage for its temporary config and left it in place for the tests after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
202b64cf1e
commit
2a1a8f046e
1 file changed
+6
-2
@@ -684,10 +684,14 @@ func TestPasswordStoredObscured(t *testing.T) {
|
||||
const password, mailboxPassword = "stored-Hunter2-1a2b3c", "stored-mailbox-4d5e6f"
|
||||
srv := protontest.New(t)
|
||||
srv.AddTwoPasswordUser("user", password, mailboxPassword)
|
||||
oldPath := config.GetConfigPath()
|
||||
oldPath, oldData := config.GetConfigPath(), config.Data()
|
||||
path := filepath.Join(t.TempDir(), "rclone.conf")
|
||||
require.NoError(t, config.SetConfigPath(path))
|
||||
t.Cleanup(func() { _ = config.SetConfigPath(oldPath) })
|
||||
t.Cleanup(func() {
|
||||
assert.NoError(t, config.SetConfigPath(oldPath))
|
||||
config.SetData(oldData)
|
||||
assert.True(t, config.Data() == oldData, "the config storage isn't restored")
|
||||
})
|
||||
configfile.Install()
|
||||
|
||||
// As "rclone config create obscured protondrive ... --obscure".
|
||||
|
||||
Reference in new issue
Block a user