From ddabfe0206c4fa93efb04942dc4c11c6a062d026 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 6 Apr 2021 07:57:27 +0200 Subject: [PATCH] adjust tests to match new exchangelist output --- tests/commands/test_commands.py | 10 +++++----- tests/test_main.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index e21ef4dd1..232fc4e2c 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -66,8 +66,8 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() assert re.match(r"Exchanges available for Freqtrade.*", captured.out) - assert re.match(r".*binance,.*", captured.out) - assert re.match(r".*bittrex,.*", captured.out) + assert re.search(r".*binance.*", captured.out) + assert re.search(r".*bittrex.*", captured.out) # Test with --one-column args = [ @@ -89,9 +89,9 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() assert re.match(r"All exchanges supported by the ccxt library.*", captured.out) - assert re.match(r".*binance,.*", captured.out) - assert re.match(r".*bittrex,.*", captured.out) - assert re.match(r".*bitmex,.*", captured.out) + assert re.search(r".*binance.*", captured.out) + assert re.search(r".*bittrex.*", captured.out) + assert re.search(r".*bitmex.*", captured.out) # Test with --one-column --all args = [ diff --git a/tests/test_main.py b/tests/test_main.py index 70632aeaa..d52dcaf79 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -118,7 +118,7 @@ def test_main_operational_exception(mocker, default_conf, caplog) -> None: def test_main_operational_exception1(mocker, default_conf, caplog) -> None: patch_exchange(mocker) mocker.patch( - 'freqtrade.commands.list_commands.available_exchanges', + 'freqtrade.commands.list_commands.validate_exchanges', MagicMock(side_effect=ValueError('Oh snap!')) ) patched_configuration_load_config_file(mocker, default_conf) @@ -132,7 +132,7 @@ def test_main_operational_exception1(mocker, default_conf, caplog) -> None: assert log_has('Fatal exception!', caplog) assert not log_has_re(r'SIGINT.*', caplog) mocker.patch( - 'freqtrade.commands.list_commands.available_exchanges', + 'freqtrade.commands.list_commands.validate_exchanges', MagicMock(side_effect=KeyboardInterrupt) ) with pytest.raises(SystemExit):