Check if timeframe is available before calling exchange

closes #6517
This commit is contained in:
Matthias
2022-03-11 17:59:57 +01:00
parent 24f480b4ce
commit 11c76c3c89
3 changed files with 33 additions and 15 deletions

View File

@@ -1692,6 +1692,13 @@ def test_refresh_latest_ohlcv(mocker, default_conf, caplog) -> None:
cache=False)
assert len(res) == 3
assert exchange._api_async.fetch_ohlcv.call_count == 3
exchange._api_async.fetch_ohlcv.reset_mock()
caplog.clear()
# Call with invalid timeframe
res = exchange.refresh_latest_ohlcv([('IOTA/ETH', '3m')],cache=False)
assert not res
assert len(res) == 0
assert log_has_re(r'Cannot download \(IOTA\/ETH, 3m\).*', caplog)
@pytest.mark.asyncio