Skip to content

Commit

Permalink
[Tests] add test_get_api_key_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 23, 2024
1 parent fadb846 commit 6c8ecaa
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_ascendex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions additional_tests/exchanges_tests/test_binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_binance_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 4 additions & 2 deletions additional_tests/exchanges_tests/test_bingx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_bitget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_bybit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_bybit_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_coinbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_coinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_cryptocom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_hollaex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_htx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions additional_tests/exchanges_tests/test_kucoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions additional_tests/exchanges_tests/test_kucoin_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_mexc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions additional_tests/exchanges_tests/test_okx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions additional_tests/exchanges_tests/test_okx_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions additional_tests/exchanges_tests/test_phemex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 6c8ecaa

Please sign in to comment.