mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
test: update tests to recognize early failing
This commit is contained in:
@@ -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.data.history.history_utils import download_data_main
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
from freqtrade.exceptions import OperationalException
|
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):
|
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 = setup_utils_configuration({"exchange": "binance"}, RunMode.UTIL_EXCHANGE)
|
||||||
config.update({"days": 20, "pairs": ["ETH/BTC", "XRP/BTC"], "timeframes": ["5m", "1h"]})
|
config.update({"days": 20, "pairs": ["ETH/BTC", "XRP/BTC"], "timeframes": ["5m", "1h"]})
|
||||||
download_data_main(config)
|
download_data_main(config)
|
||||||
assert dl_mock.call_args[1]["timerange"].starttype == "date"
|
assert dl_mock.call_count == 0
|
||||||
assert log_has("Pairs [ETH/BTC,XRP/BTC] not available on exchange Binance.", caplog)
|
assert log_has_re("No pairs available for download..*", caplog)
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_main_all_pairs(mocker, markets):
|
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=[])
|
"freqtrade.data.history.history_utils.convert_trades_to_ohlcv", MagicMock(return_value=[])
|
||||||
)
|
)
|
||||||
patch_exchange(mocker)
|
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 = setup_utils_configuration({"exchange": "binance"}, RunMode.UTIL_EXCHANGE)
|
||||||
config.update(
|
config.update(
|
||||||
{
|
{
|
||||||
@@ -91,7 +91,7 @@ def test_download_data_main_trades(mocker):
|
|||||||
|
|
||||||
def test_download_data_main_data_invalid(mocker):
|
def test_download_data_main_data_invalid(mocker):
|
||||||
patch_exchange(mocker, exchange="kraken")
|
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 = setup_utils_configuration({"exchange": "kraken"}, RunMode.UTIL_EXCHANGE)
|
||||||
config.update(
|
config.update(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user