From ba664c43415eea57f7a0373cc48e2a3668fe8053 Mon Sep 17 00:00:00 2001 From: Gerald Lonlas Date: Sun, 4 Mar 2018 23:12:34 -0800 Subject: [PATCH] Increase Configuration._load_hyperopt_config() code coverage --- freqtrade/tests/test_configuration.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/freqtrade/tests/test_configuration.py b/freqtrade/tests/test_configuration.py index 0c532ae73..195679bfa 100644 --- a/freqtrade/tests/test_configuration.py +++ b/freqtrade/tests/test_configuration.py @@ -263,7 +263,7 @@ def test_setup_configuration_with_arguments(mocker, default_conf, caplog) -> Non ) -def test_hyperopt_space_argument(mocker, default_conf, caplog) -> None: +def test_hyperopt_with_arguments(mocker, default_conf, caplog) -> None: """ Test setup_configuration() function """ @@ -273,6 +273,8 @@ def test_hyperopt_space_argument(mocker, default_conf, caplog) -> None: args = [ 'hyperopt', + '--epochs', '10', + '--use-mongodb', '--spaces', 'all', ] @@ -280,6 +282,16 @@ def test_hyperopt_space_argument(mocker, default_conf, caplog) -> None: configuration = Configuration(args) config = configuration.get_config() + + assert 'epochs' in config + assert int(config['epochs']) == 10 + assert log_has('Parameter --epochs detected ...', caplog.record_tuples) + assert log_has('Will run Hyperopt with for 10 epochs ...', caplog.record_tuples) + + assert 'mongodb' in config + assert config['mongodb'] is True + assert log_has('Parameter --use-mongodb detected ...', caplog.record_tuples) + assert 'spaces' in config assert config['spaces'] == ['all'] assert log_has('Parameter -s/--spaces detected: [\'all\']', caplog.record_tuples)