From db160989814e9a1dda15e8e3722bdd8add186cf0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 23 Nov 2021 17:43:37 +0100 Subject: [PATCH] Fix Tests --- freqtrade/exchange/binance.py | 4 ++-- freqtrade/exchange/exchange.py | 2 +- tests/exchange/test_exchange.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index 0c891924f..7540fc98a 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -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()}.") diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 7201c025e..af1e429e3 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -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)) diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index d8f4be660..39c367b7e 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -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