fix 'max_open_trades must be greater than 0' regression

This commit is contained in:
gcarq
2018-05-03 10:48:25 +02:00
parent a5c1547251
commit 43fd9b37df
2 changed files with 16 additions and 1 deletions

View File

@@ -69,6 +69,21 @@ def test_load_config_file(default_conf, mocker, caplog) -> None:
assert log_has('Validating configuration ...', caplog.record_tuples)
def test_load_config_max_open_trades_zero(default_conf, mocker, caplog) -> None:
"""
Test Configuration._load_config_file() method
"""
conf = deepcopy(default_conf)
conf['max_open_trades'] = 0
file_mock = mocker.patch('freqtrade.configuration.open', mocker.mock_open(
read_data=json.dumps(conf)
))
Configuration([])._load_config_file('somefile')
assert file_mock.call_count == 1
assert log_has('Validating configuration ...', caplog.record_tuples)
def test_load_config_file_exception(mocker, caplog) -> None:
"""
Test Configuration._load_config_file() method