mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-12 19:23:55 +00:00
Prevent data-downloads for exchanges that don't support this.
This commit is contained in:
parent
776a8e43cd
commit
02c38f7396
|
@ -618,6 +618,11 @@ def download_data_main(config: Config) -> None:
|
||||||
# Start downloading
|
# Start downloading
|
||||||
try:
|
try:
|
||||||
if config.get("download_trades"):
|
if config.get("download_trades"):
|
||||||
|
if not exchange.get_option("trades_has_history", True):
|
||||||
|
raise OperationalException(
|
||||||
|
f"Trade history not available for {exchange.name}. "
|
||||||
|
"You cannot use --dl-trades for this exchange."
|
||||||
|
)
|
||||||
pairs_not_available = refresh_backtest_trades_data(
|
pairs_not_available = refresh_backtest_trades_data(
|
||||||
exchange,
|
exchange,
|
||||||
pairs=expanded_pairs,
|
pairs=expanded_pairs,
|
||||||
|
|
|
@ -83,6 +83,12 @@ def test_download_data_main_trades(mocker):
|
||||||
assert dl_mock.call_count == 1
|
assert dl_mock.call_count == 1
|
||||||
assert convert_mock.call_count == 1
|
assert convert_mock.call_count == 1
|
||||||
|
|
||||||
|
# Exchange that doesn't support historic downloads
|
||||||
|
config["exchange"]["name"] = "bybit"
|
||||||
|
with pytest.raises(OperationalException, match=r"Trade history not available for .*"):
|
||||||
|
config
|
||||||
|
download_data_main(config)
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_main_data_invalid(mocker):
|
def test_download_data_main_data_invalid(mocker):
|
||||||
patch_exchange(mocker, id="kraken")
|
patch_exchange(mocker, id="kraken")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user