Improve kraken test resiliance

This commit is contained in:
Matthias 2022-12-08 08:33:07 +01:00
parent b9f6911a6a
commit 74e623fe5b

View File

@ -224,6 +224,11 @@ class TestCCXTExchange():
for val in [1, 2, 5, 25, 100]: for val in [1, 2, 5, 25, 100]:
l2 = exchange.fetch_l2_order_book(pair, val) l2 = exchange.fetch_l2_order_book(pair, val)
if not l2_limit_range or val in l2_limit_range: if not l2_limit_range or val in l2_limit_range:
if val > 50:
# Orderbooks are not always this deep.
assert val - 5 < len(l2['asks']) <= val
assert val - 5 < len(l2['bids']) <= val
else:
assert len(l2['asks']) == val assert len(l2['asks']) == val
assert len(l2['bids']) == val assert len(l2['bids']) == val
else: else: