Fix Tests

This commit is contained in:
Matthias 2021-11-23 17:43:37 +01:00
parent 920151934a
commit db16098981
3 changed files with 5 additions and 5 deletions

View File

@ -212,9 +212,9 @@ class Binance(Exchange):
"""
if is_new_pair:
x = await self._async_get_candle_history(pair, timeframe, 0, candle_type)
if x and x[2] and x[2][0] and x[2][0][0] > since_ms:
if x and x[3] and x[3][0] and x[3][0][0] > since_ms:
# Set starting date to first available candle.
since_ms = x[2][0][0]
since_ms = x[3][0][0]
logger.info(f"Candle-data for {pair} available starting with "
f"{arrow.get(since_ms // 1000).isoformat()}.")

View File

@ -1419,7 +1419,7 @@ class Exchange:
pair, timeframe, since_ms=since_ms, candle_type=candle_type))
else:
logger.debug(
"Using cached candle (OHLCV) data for pair %s, timeframe %s ...",
"Using cached candle (OHLCV) data for pair %s, timeframe %s, candleType %s ...",
pair, timeframe, candle_type
)
cached_pairs.append((pair, timeframe, candle_type))

View File

@ -1748,13 +1748,13 @@ def test_refresh_latest_ohlcv(mocker, default_conf, caplog) -> None:
assert exchange._api_async.fetch_ohlcv.call_count == 0
assert log_has(f"Using cached candle (OHLCV) data for pair {pairs[0][0]}, "
f"timeframe {pairs[0][1]} ...",
f"timeframe {pairs[0][1]}, candleType ...",
caplog)
res = exchange.refresh_latest_ohlcv(
[('IOTA/ETH', '5m', ''), ('XRP/ETH', '5m', ''), ('XRP/ETH', '1d', '')],
cache=False
)
assert len(res) == 4
assert len(res) == 3
@pytest.mark.asyncio