test: update tests to recognize early failing

This commit is contained in:
Matthias
2024-11-16 11:01:55 +01:00
parent f11e5128ad
commit 20e77bb5d9

View File

@@ -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(
{