diff --git a/tests/data/test_download_data.py b/tests/data/test_download_data.py index f26a30ce1..ef1d938d3 100644 --- a/tests/data/test_download_data.py +++ b/tests/data/test_download_data.py @@ -6,7 +6,7 @@ from freqtrade.configuration.config_setup import setup_utils_configuration from freqtrade.data.history.history_utils import download_data_main from freqtrade.enums import RunMode from freqtrade.exceptions import OperationalException -from tests.conftest import EXMS, log_has, patch_exchange +from tests.conftest import EXMS, log_has_re, patch_exchange def test_download_data_main_no_markets(mocker, caplog): @@ -19,8 +19,8 @@ def test_download_data_main_no_markets(mocker, caplog): config = setup_utils_configuration({"exchange": "binance"}, RunMode.UTIL_EXCHANGE) config.update({"days": 20, "pairs": ["ETH/BTC", "XRP/BTC"], "timeframes": ["5m", "1h"]}) download_data_main(config) - assert dl_mock.call_args[1]["timerange"].starttype == "date" - assert log_has("Pairs [ETH/BTC,XRP/BTC] not available on exchange Binance.", caplog) + assert dl_mock.call_count == 0 + assert log_has_re("No pairs available for download..*", caplog) def test_download_data_main_all_pairs(mocker, markets): @@ -55,7 +55,7 @@ def test_download_data_main_trades(mocker): "freqtrade.data.history.history_utils.convert_trades_to_ohlcv", MagicMock(return_value=[]) ) patch_exchange(mocker) - mocker.patch(f"{EXMS}.get_markets", return_value={}) + mocker.patch(f"{EXMS}.get_markets", return_value={"ETH/BTC": {}, "XRP/BTC": {}}) config = setup_utils_configuration({"exchange": "binance"}, RunMode.UTIL_EXCHANGE) config.update( { @@ -91,7 +91,7 @@ def test_download_data_main_trades(mocker): def test_download_data_main_data_invalid(mocker): patch_exchange(mocker, exchange="kraken") - mocker.patch(f"{EXMS}.get_markets", return_value={}) + mocker.patch(f"{EXMS}.get_markets", return_value={"ETH/BTC": {}}) config = setup_utils_configuration({"exchange": "kraken"}, RunMode.UTIL_EXCHANGE) config.update( {