test: further add tests for public trades dl

This commit is contained in:
Matthias
2025-01-30 07:13:03 +01:00
parent 3e1daf50b0
commit 92405f94ec
2 changed files with 12 additions and 2 deletions

View File

@@ -325,7 +325,7 @@ async def download_archive_trades(
except Exception as e:
logger.warning(
"An exception occurred during fast traes download from Binance, falling back to "
"An exception occurred during fast trades download from Binance, falling back to "
"the slower REST API, this can take a lot more time.",
exc_info=e,
)

View File

@@ -395,7 +395,7 @@ async def test_download_archive_trades(mocker, caplog):
assert log_has_re(r"Binance fast download .*stopped", caplog)
async def test_download_archive_trades_exception(mocker):
async def test_download_archive_trades_exception(mocker, caplog):
pair = "BTC/USDT"
since_ms = dt_ts(dt_utc(2020, 1, 1))
@@ -412,6 +412,16 @@ async def test_download_archive_trades_exception(mocker):
assert pair1 == pair
assert res == []
mocker.patch(
"freqtrade.exchange.binance_public_data._download_archive_trades", side_effect=RuntimeError
)
await download_archive_trades(
CandleType.SPOT, pair, since_ms=since_ms, until_ms=until_ms, markets=markets
)
assert pair1 == pair
assert res == []
assert log_has_re("An exception occurred during fast trades download", caplog)
async def test_binance_vision_trades_zip_url():