mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 04:03:55 +00:00
Mock create_datadir to make sure no folders are left behind
This commit is contained in:
parent
f0cf8d6a81
commit
15a4df4c49
|
@ -143,12 +143,10 @@ def test_from_config(default_conf, mocker, caplog) -> None:
|
||||||
conf2['exchange']['pair_whitelist'] += ['NANO/BTC']
|
conf2['exchange']['pair_whitelist'] += ['NANO/BTC']
|
||||||
conf2['fiat_display_currency'] = "EUR"
|
conf2['fiat_display_currency'] = "EUR"
|
||||||
config_files = [conf1, conf2]
|
config_files = [conf1, conf2]
|
||||||
|
mocker.patch('freqtrade.configuration.configuration.create_datadir', lambda c, x: x)
|
||||||
|
|
||||||
configsmock = MagicMock(side_effect=config_files)
|
configsmock = MagicMock(side_effect=config_files)
|
||||||
mocker.patch(
|
mocker.patch('freqtrade.configuration.configuration.load_config_file',configsmock)
|
||||||
'freqtrade.configuration.configuration.load_config_file',
|
|
||||||
configsmock
|
|
||||||
)
|
|
||||||
|
|
||||||
validated_conf = Configuration.from_files(['test_conf.json', 'test2_conf.json'])
|
validated_conf = Configuration.from_files(['test_conf.json', 'test2_conf.json'])
|
||||||
|
|
||||||
|
@ -171,10 +169,8 @@ def test_print_config(default_conf, mocker, caplog) -> None:
|
||||||
config_files = [conf1]
|
config_files = [conf1]
|
||||||
|
|
||||||
configsmock = MagicMock(side_effect=config_files)
|
configsmock = MagicMock(side_effect=config_files)
|
||||||
mocker.patch(
|
mocker.patch('freqtrade.configuration.configuration.create_datadir', lambda c, x: x)
|
||||||
'freqtrade.configuration.configuration.load_config_file',
|
mocker.patch('freqtrade.configuration.configuration.load_config_file', configsmock)
|
||||||
configsmock
|
|
||||||
)
|
|
||||||
|
|
||||||
validated_conf = Configuration.from_files(['test_conf.json'])
|
validated_conf = Configuration.from_files(['test_conf.json'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user