From 6c55b40fe04f4cea4b92841212b150d69f5d200a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 22 Mar 2020 20:15:33 +0100 Subject: [PATCH] Add test verifying config printing --- tests/test_configuration.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 1e9d6440d..ec6753feb 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -66,6 +66,17 @@ def test_load_config_file(default_conf, mocker, caplog) -> None: assert validated_conf.items() >= default_conf.items() +def test_load_config_file_error(default_conf, mocker, caplog) -> None: + del default_conf['user_data_dir'] + filedata = json.dumps(default_conf).replace( + '"stake_amount": 0.001,', '"stake_amount": .001,') + mocker.patch('freqtrade.configuration.load_config.open', mocker.mock_open(read_data=filedata)) + mocker.patch.object(Path, "read_text", MagicMock(return_value=filedata)) + + with pytest.raises(OperationalException, match=f".*Please verify the following segment.*"): + load_config_file('somefile') + + def test__args_to_config(caplog): arg_list = ['trade', '--strategy-path', 'TestTest']