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,8 +224,13 @@ class TestCCXTExchange():
for val in [1, 2, 5, 25, 100]:
l2 = exchange.fetch_l2_order_book(pair, val)
if not l2_limit_range or val in l2_limit_range:
assert len(l2['asks']) == val
assert len(l2['bids']) == val
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['bids']) == val
else:
next_limit = exchange.get_next_limit_in_list(
val, l2_limit_range, l2_limit_range_required)