diff --git a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py index c724069a2..1f0029ab9 100644 --- a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py +++ b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py @@ -30,6 +30,7 @@ import octobot_trading.personal_data.orders as personal_data_orders import octobot_trading.util.test_tools.exchanges_test_tools as exchanges_test_tools import octobot_trading.util.test_tools.exchange_data as exchange_data_import +import trading_backend.enums import octobot_tentacles_manager.api as tentacles_manager_api from additional_tests.exchanges_tests import get_authenticated_exchange_manager @@ -123,6 +124,17 @@ async def inner_test_get_account_id(self): with pytest.raises(NotImplementedError): await self.exchange_manager.exchange.get_account_id() + async def test_get_api_key_permissions(self): + async with self.local_exchange_manager(): + await self.inner_test_get_api_key_permissions() + + async def inner_test_get_api_key_permissions(self): + permissions = await self.exchange_manager.exchange_backend._get_api_key_rights() + assert len(permissions) > 0 + assert trading_backend.enums.APIKeyRights.READING in permissions + assert trading_backend.enums.APIKeyRights.SPOT_TRADING in permissions + assert trading_backend.enums.APIKeyRights.FUTURES_TRADING in permissions + async def test_create_and_cancel_limit_orders(self): async with self.local_exchange_manager(): await self.inner_test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_ascendex.py b/additional_tests/exchanges_tests/test_ascendex.py index 4b2cf6fb1..553c2528a 100644 --- a/additional_tests/exchanges_tests/test_ascendex.py +++ b/additional_tests/exchanges_tests/test_ascendex.py @@ -43,6 +43,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_binance.py b/additional_tests/exchanges_tests/test_binance.py index c5d2cf152..c1ef37ce7 100644 --- a/additional_tests/exchanges_tests/test_binance.py +++ b/additional_tests/exchanges_tests/test_binance.py @@ -41,6 +41,9 @@ async def test_get_portfolio_with_market_filter(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_binance_futures.py b/additional_tests/exchanges_tests/test_binance_futures.py index c108e140d..15a87c047 100644 --- a/additional_tests/exchanges_tests/test_binance_futures.py +++ b/additional_tests/exchanges_tests/test_binance_futures.py @@ -50,6 +50,10 @@ async def test_get_portfolio_with_market_filter(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_get_empty_linear_and_inverse_positions(self): await super().test_get_empty_linear_and_inverse_positions() diff --git a/additional_tests/exchanges_tests/test_bingx.py b/additional_tests/exchanges_tests/test_bingx.py index 3d74fec20..285fa0a0c 100644 --- a/additional_tests/exchanges_tests/test_bingx.py +++ b/additional_tests/exchanges_tests/test_bingx.py @@ -40,8 +40,10 @@ async def test_get_portfolio_with_market_filter(self): await super().test_get_portfolio_with_market_filter() async def test_get_account_id(self): - # pass if not implemented - pass + await super().test_get_account_id() + + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_bitget.py b/additional_tests/exchanges_tests/test_bitget.py index ffb860bc5..cc576a404 100644 --- a/additional_tests/exchanges_tests/test_bitget.py +++ b/additional_tests/exchanges_tests/test_bitget.py @@ -45,6 +45,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): # KYC needed 8th jan 2024 ccxt 4.2.10 await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_bybit.py b/additional_tests/exchanges_tests/test_bybit.py index 3698f9863..7db854fb0 100644 --- a/additional_tests/exchanges_tests/test_bybit.py +++ b/additional_tests/exchanges_tests/test_bybit.py @@ -47,6 +47,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_bybit_futures.py b/additional_tests/exchanges_tests/test_bybit_futures.py index df4bddfa1..2c63f0bb5 100644 --- a/additional_tests/exchanges_tests/test_bybit_futures.py +++ b/additional_tests/exchanges_tests/test_bybit_futures.py @@ -48,6 +48,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_get_empty_linear_and_inverse_positions(self): await super().test_get_empty_linear_and_inverse_positions() diff --git a/additional_tests/exchanges_tests/test_coinbase.py b/additional_tests/exchanges_tests/test_coinbase.py index 6cb7ed0ee..9caaf71da 100644 --- a/additional_tests/exchanges_tests/test_coinbase.py +++ b/additional_tests/exchanges_tests/test_coinbase.py @@ -43,6 +43,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_coinex.py b/additional_tests/exchanges_tests/test_coinex.py index e2e50759f..0536976cf 100644 --- a/additional_tests/exchanges_tests/test_coinex.py +++ b/additional_tests/exchanges_tests/test_coinex.py @@ -42,6 +42,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_cryptocom.py b/additional_tests/exchanges_tests/test_cryptocom.py index 5815b0993..c38218010 100644 --- a/additional_tests/exchanges_tests/test_cryptocom.py +++ b/additional_tests/exchanges_tests/test_cryptocom.py @@ -43,6 +43,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_hollaex.py b/additional_tests/exchanges_tests/test_hollaex.py index 63719dd54..60754118a 100644 --- a/additional_tests/exchanges_tests/test_hollaex.py +++ b/additional_tests/exchanges_tests/test_hollaex.py @@ -46,6 +46,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_htx.py b/additional_tests/exchanges_tests/test_htx.py index 8ff2cecf7..4dabe417f 100644 --- a/additional_tests/exchanges_tests/test_htx.py +++ b/additional_tests/exchanges_tests/test_htx.py @@ -43,6 +43,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_kucoin.py b/additional_tests/exchanges_tests/test_kucoin.py index 63725ec16..14c022e43 100644 --- a/additional_tests/exchanges_tests/test_kucoin.py +++ b/additional_tests/exchanges_tests/test_kucoin.py @@ -43,6 +43,9 @@ async def test_create_and_cancel_limit_orders(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() + async def test_create_and_fill_market_orders(self): await super().test_create_and_fill_market_orders() diff --git a/additional_tests/exchanges_tests/test_kucoin_futures.py b/additional_tests/exchanges_tests/test_kucoin_futures.py index a50e6c085..3a105151b 100644 --- a/additional_tests/exchanges_tests/test_kucoin_futures.py +++ b/additional_tests/exchanges_tests/test_kucoin_futures.py @@ -45,6 +45,9 @@ async def test_get_portfolio_with_market_filter(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() + async def test_get_empty_linear_and_inverse_positions(self): await super().test_get_empty_linear_and_inverse_positions() diff --git a/additional_tests/exchanges_tests/test_mexc.py b/additional_tests/exchanges_tests/test_mexc.py index 39bda1bdf..71e70081c 100644 --- a/additional_tests/exchanges_tests/test_mexc.py +++ b/additional_tests/exchanges_tests/test_mexc.py @@ -45,6 +45,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/additional_tests/exchanges_tests/test_okx.py b/additional_tests/exchanges_tests/test_okx.py index 24ff343b5..eb59e7d48 100644 --- a/additional_tests/exchanges_tests/test_okx.py +++ b/additional_tests/exchanges_tests/test_okx.py @@ -43,6 +43,9 @@ async def test_create_and_cancel_limit_orders(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() + async def test_create_and_fill_market_orders(self): await super().test_create_and_fill_market_orders() diff --git a/additional_tests/exchanges_tests/test_okx_futures.py b/additional_tests/exchanges_tests/test_okx_futures.py index 56256dc89..0b54552eb 100644 --- a/additional_tests/exchanges_tests/test_okx_futures.py +++ b/additional_tests/exchanges_tests/test_okx_futures.py @@ -44,6 +44,9 @@ async def test_get_portfolio_with_market_filter(self): async def test_get_account_id(self): await super().test_get_account_id() + async def test_get_api_key_permissions(self): + await super().test_get_api_key_permissions() + async def test_get_empty_linear_and_inverse_positions(self): await super().test_get_empty_linear_and_inverse_positions() diff --git a/additional_tests/exchanges_tests/test_phemex.py b/additional_tests/exchanges_tests/test_phemex.py index 47e694958..9e399be3d 100644 --- a/additional_tests/exchanges_tests/test_phemex.py +++ b/additional_tests/exchanges_tests/test_phemex.py @@ -42,6 +42,10 @@ async def test_get_account_id(self): # pass if not implemented pass + async def test_get_api_key_permissions(self): + # pass if not implemented + pass + async def test_create_and_cancel_limit_orders(self): await super().test_create_and_cancel_limit_orders() diff --git a/requirements.txt b/requirements.txt index be3e1ef79..5624a8f87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ OctoBot-Tentacles-Manager==2.9.9 OctoBot-Services==1.6.10 OctoBot-Backtesting==1.9.7 Async-Channel==2.2.1 -trading-backend==1.2.13 +trading-backend==1.2.14 ## Others colorlog==6.8.0