diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 330b82d39..0f2d6a50a 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -506,7 +506,8 @@ def test_check_exchange(default_conf, caplog) -> None: # Test an available exchange, supported by ccxt default_conf.get('exchange').update({'name': 'huobipro'}) assert check_exchange(default_conf) - assert log_has_re(r"Exchange .* is supported by ccxt and .* not officially supported " + assert log_has_re(r"Exchange .* is known to the the ccxt library, available for the bot, " + r"but not officially supported " r"by the Freqtrade development team\. .*", caplog) caplog.clear() @@ -520,16 +521,16 @@ def test_check_exchange(default_conf, caplog) -> None: # Test a 'bad' exchange with check_for_bad=False default_conf.get('exchange').update({'name': 'bitmex'}) assert check_exchange(default_conf, False) - assert log_has_re(r"Exchange .* is supported by ccxt and .* not officially supported " + assert log_has_re(r"Exchange .* is known to the the ccxt library, available for the bot, " + r"but not officially supported " r"by the Freqtrade development team\. .*", caplog) caplog.clear() # Test an invalid exchange default_conf.get('exchange').update({'name': 'unknown_exchange'}) - with pytest.raises( OperationalException, - match=r'.*Exchange "unknown_exchange" is not supported by ccxt ' + match=r'Exchange "unknown_exchange" is not known to the ccxt library ' r'and therefore not available for the bot.*' ): check_exchange(default_conf) diff --git a/tests/test_utils.py b/tests/test_utils.py index c99044610..9025e4906 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -31,7 +31,7 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() - assert re.match(r"Exchanges supported by ccxt and available.*", captured.out) + assert re.match(r"Exchanges available for Freqtrade.*", captured.out) assert re.match(r".*binance,.*", captured.out) assert re.match(r".*bittrex,.*", captured.out) @@ -43,10 +43,35 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() - assert not re.match(r"Exchanges supported by ccxt and available.*", captured.out) assert re.search(r"^binance$", captured.out, re.MULTILINE) assert re.search(r"^bittrex$", captured.out, re.MULTILINE) + # Test with --all + args = [ + "list-exchanges", + "--all", + ] + + 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) + + # Test with --one-column --all + args = [ + "list-exchanges", + "--one-column", + "--all", + ] + + start_list_exchanges(get_args(args)) + captured = capsys.readouterr() + assert re.search(r"^binance$", captured.out, re.MULTILINE) + assert re.search(r"^bittrex$", captured.out, re.MULTILINE) + assert re.search(r"^bitmex$", captured.out, re.MULTILINE) + def test_create_datadir_failed(caplog):