add --epochs to hyperopt subcommand

This commit is contained in:
gcarq
2017-11-25 01:12:44 +01:00
parent b9c4eafd96
commit 9ff1f05e66
4 changed files with 34 additions and 8 deletions

View File

@@ -112,6 +112,20 @@ def test_parse_args_hyperopt(mocker):
assert call_args.func is not None
def test_parse_args_hyperopt_custom(mocker):
hyperopt_mock = mocker.patch('freqtrade.optimize.hyperopt.start', MagicMock())
args = parse_args(['-c', 'test_conf.json', 'hyperopt', '--epochs', '20'])
assert args is None
assert hyperopt_mock.call_count == 1
call_args = hyperopt_mock.call_args[0][0]
assert call_args.config == 'test_conf.json'
assert call_args.epochs == 20
assert call_args.loglevel == 20
assert call_args.subparser == 'hyperopt'
assert call_args.func is not None
def test_load_config(default_conf, mocker):
file_mock = mocker.patch('freqtrade.misc.open', mocker.mock_open(
read_data=json.dumps(default_conf)