mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-15 18:50:30 +00:00
Don't modify original config
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
from freqtrade.constants import Config
|
||||
|
||||
@@ -22,7 +22,7 @@ def sanitize_config(config: Config, *, show_sensitive: bool = False) -> Config:
|
||||
"discord.webhook_url",
|
||||
"api_server.password",
|
||||
]
|
||||
|
||||
config = deepcopy(config)
|
||||
for key in keys_to_remove:
|
||||
if '.' in key:
|
||||
nested_keys = key.split('.')
|
||||
|
||||
@@ -1510,7 +1510,10 @@ def test_setup_freqai_backtesting(mocker, default_conf) -> None:
|
||||
|
||||
|
||||
def test_sanitize_config(default_conf_usdt):
|
||||
assert default_conf_usdt['exchange']['key'] != 'REDACTED'
|
||||
res = sanitize_config(default_conf_usdt)
|
||||
# Didn't modify original dict
|
||||
assert default_conf_usdt['exchange']['key'] != 'REDACTED'
|
||||
|
||||
assert res['exchange']['key'] == 'REDACTED'
|
||||
assert res['exchange']['secret'] == 'REDACTED'
|
||||
|
||||
Reference in New Issue
Block a user