Skip to content

Commit

Permalink
[Tests] fix open orders check test
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jul 15, 2024
1 parent e60bab3 commit 92c03b8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,9 @@ async def order_in_fetched_orders(self, method, previous_orders, order, symbol=N
print(f"=> {self.exchange_manager.exchange_name} {order.order_type} Order found in {len(fetched_orders)} "
f"{method.__name__} after after {time.time() - t0} seconds and {iterations} iterations. "
f"Order: [{order}].")
assert len(fetched_orders) == len(previous_orders) + 1
# use in as exchanges can have a max amount of fetched elements
assert len(fetched_orders) in (len(previous_orders), len(previous_orders) + 1), \
f"{len(fetched_orders)} not in {len(previous_orders), len(previous_orders) + 1}"
return True
else:
# check order not in open orders
Expand All @@ -1039,7 +1041,7 @@ async def order_in_fetched_orders(self, method, previous_orders, order, symbol=N
f" in {len(fetched_orders)} {method.__name__} after after {time.time() - t0} seconds "
f"and {iterations} iterations. "
f"Order: [{order}].")
assert len(fetched_orders) == max(len(previous_orders) - 1, 0)
assert len(fetched_orders) <= len(previous_orders), f"{len(fetched_orders)} !<= {len(previous_orders)}"
# order not found
return True
await asyncio.sleep(1)
Expand Down

0 comments on commit 92c03b8

Please sign in to comment.