Skip to content

Commit

Permalink
[Tests] update exchange leverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 5, 2025
1 parent 0d757db commit 17404e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class AbstractAuthenticatedFutureExchangeTester(
INVERSE_SYMBOL = None
MIN_PORTFOLIO_SIZE = 2 # ensure fetching currency for linear and inverse
SUPPORTS_GET_LEVERAGE = True
SUPPORTS_SET_LEVERAGE = True
SUPPORTS_EMPTY_POSITION_SET_MARGIN_TYPE = True

async def test_get_empty_linear_and_inverse_positions(self):
Expand Down Expand Up @@ -85,9 +84,12 @@ async def inner_test_get_and_set_leverage(self):
assert origin_leverage != trading_constants.ZERO
if self.SUPPORTS_GET_LEVERAGE:
assert origin_leverage == await self.get_leverage()
if not self.SUPPORTS_SET_LEVERAGE:
return
new_leverage = origin_leverage + 1
if not self.exchange_manager.exchange.UPDATE_LEVERAGE_FROM_API:
# can't set from api: make sure of that
with pytest.raises(trading_errors.NotSupported):
await self.exchange_manager.exchange.connector.set_symbol_leverage(self.SYMBOL, float(new_leverage))
return
await self.set_leverage(new_leverage)
await self._check_margin_type_and_leverage(origin_margin_type, new_leverage) # did not change margin type
# change leverage back to origin value
Expand Down
1 change: 0 additions & 1 deletion additional_tests/exchanges_tests/test_kucoin_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class TestKucoinFuturesAuthenticatedExchange(
INVERSE_SYMBOL = f"{ORDER_CURRENCY}/USD:{ORDER_CURRENCY}"
ORDER_SIZE = 5 # % of portfolio to include in test orders
SUPPORTS_GET_LEVERAGE = False
SUPPORTS_SET_LEVERAGE = False
USE_ORDER_OPERATION_TO_CHECK_API_KEY_RIGHTS = True
VALID_ORDER_ID = "6617e84c5c1e0000083c71f7"
EXPECT_MISSING_FEE_IN_CANCELLED_ORDERS = False
Expand Down

0 comments on commit 17404e6

Please sign in to comment.