From e654b76bc8ed24fe6bce239de1cfe6dd927de6b7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 10 Aug 2018 09:44:03 +0200 Subject: [PATCH] Fix async test --- freqtrade/tests/exchange/test_exchange.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/tests/exchange/test_exchange.py b/freqtrade/tests/exchange/test_exchange.py index 3a7573f70..ab25a5a7a 100644 --- a/freqtrade/tests/exchange/test_exchange.py +++ b/freqtrade/tests/exchange/test_exchange.py @@ -584,11 +584,15 @@ async def test_async_get_candles_history(default_conf, mocker): async def async_fetch_ohlcv(pair, timeframe, since): return tick + async def async_load_markets(): + return {} + exchange = get_patched_exchange(mocker, default_conf) # Monkey-patch async function exchange._api_async.fetch_ohlcv = async_fetch_ohlcv - exchange = Exchange(default_conf) + exchange._api_async.load_markets = async_load_markets + pairs = ['ETH/BTC', 'XRP/BTC'] res = await exchange.async_get_candles_history(pairs, "5m") assert type(res) is list