Extract selection generation to a seperate method

This commit is contained in:
Matthias
2020-01-29 20:27:38 +01:00
parent c80d8f432a
commit dd83cb1b95
3 changed files with 44 additions and 17 deletions

View File

@@ -8,8 +8,9 @@ from freqtrade.commands import (start_create_userdir, start_download_data,
start_hyperopt_list, start_hyperopt_show,
start_list_exchanges, start_list_markets,
start_list_strategies, start_list_timeframes,
start_new_hyperopt, start_new_strategy,
start_test_pairlist, start_trading)
start_new_config, start_new_hyperopt,
start_new_strategy, start_test_pairlist,
start_trading)
from freqtrade.configuration import setup_utils_configuration
from freqtrade.exceptions import OperationalException
from freqtrade.state import RunMode
@@ -537,6 +538,22 @@ def test_start_new_hyperopt_no_arg(mocker, caplog):
start_new_hyperopt(get_args(args))
def test_start_new_config(mocker, caplog):
wt_mock = mocker.patch.object(Path, "write_text", MagicMock())
mocker.patch.object(Path, "exists", MagicMock(return_value=False))
args = [
"new-config",
"--config",
"coolconfig.json"
]
start_new_config(get_args(args))
assert wt_mock.call_count == 1
assert "binance" in wt_mock.call_args_list[0][0][0]
assert log_has_re("Writing config to .*", caplog)
def test_download_data_keyboardInterrupt(mocker, caplog, markets):
dl_mock = mocker.patch('freqtrade.commands.data_commands.refresh_backtest_ohlcv_data',
MagicMock(side_effect=KeyboardInterrupt))