test: listen forever loop fixed

api-breakage
Morty Space 4 years ago
parent afa3d4b38b
commit 7b020120a3
  1. 9
      tests/test_market.py

@ -60,13 +60,18 @@ async def test_get_candles(exchange: cro.Exchange):
@pytest.mark.asyncio
async def test_listen_candles(exchange: cro.Exchange):
candles = {}
pairs = (cro.pairs.CRO_USDC, cro.pairs.USDC_USDT, cro.pairs.BTC_USDT)
pairs = (
cro.pairs.BTC_USDC,
cro.pairs.ETH_USDT,
cro.pairs.BTC_USDT,
cro.pairs.ETH_USDC,
)
default_count = 2
async for candle in exchange.listen_candles(cro.Period.MINS, *pairs):
candles.setdefault(candle.pair, 0)
candles[candle.pair] += 1
if all(v == default_count for v in candles.values()) and len(
if all(v >= default_count for v in candles.values()) and len(
candles
) == len(pairs):
break

Loading…
Cancel
Save