From d40d4845f421eb53f74ef075d01a87c65dba5038 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 29 Dec 2024 11:52:37 +0100 Subject: [PATCH 1/2] [Tests] update futures tests --- .../abstract_authenticated_exchange_tester.py | 5 +++-- additional_tests/exchanges_tests/test_binance_futures.py | 6 ++---- additional_tests/exchanges_tests/test_kucoin_futures.py | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py index 6c737e20d..d318ad943 100644 --- a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py +++ b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py @@ -110,13 +110,14 @@ async def test_get_portfolio_with_market_filter(self): # check portfolio fetched with filtered markets (should be equal to the one with all markets) filtered_markets_portfolio = await self.get_portfolio() if self.EXPECT_BALANCE_FILTER_BY_MARKET_STATUS: - assert filtered_markets_portfolio == { + filtered = { key: val for key, val in all_markets_portfolio.items() if key in symbols.parse_symbol(self.SYMBOL).base_and_quote() } + assert filtered_markets_portfolio == filtered, f"{filtered_markets_portfolio=} != {filtered=}" else: - assert filtered_markets_portfolio == all_markets_portfolio + assert filtered_markets_portfolio == all_markets_portfolio, f"{filtered_markets_portfolio=} != {all_markets_portfolio=}" async def inner_test_get_portfolio(self): self.check_portfolio_content(await self.get_portfolio()) diff --git a/additional_tests/exchanges_tests/test_binance_futures.py b/additional_tests/exchanges_tests/test_binance_futures.py index 64850a0ad..57cc09cde 100644 --- a/additional_tests/exchanges_tests/test_binance_futures.py +++ b/additional_tests/exchanges_tests/test_binance_futures.py @@ -46,8 +46,7 @@ async def test_get_portfolio(self): await super().test_get_portfolio() async def test_get_portfolio_with_market_filter(self): - # pass if not implemented - pass + await super().test_get_portfolio_with_market_filter() # can have small variations failing the test when positions are open async def test_get_account_id(self): await super().test_get_account_id() @@ -59,8 +58,7 @@ async def test_invalid_api_key_error(self): await super().test_invalid_api_key_error() async def test_get_api_key_permissions(self): - # pass if not implemented - pass + await super().test_get_api_key_permissions() async def test_missing_trading_api_key_permissions(self): pass diff --git a/additional_tests/exchanges_tests/test_kucoin_futures.py b/additional_tests/exchanges_tests/test_kucoin_futures.py index dab1c9173..a26b66a5d 100644 --- a/additional_tests/exchanges_tests/test_kucoin_futures.py +++ b/additional_tests/exchanges_tests/test_kucoin_futures.py @@ -39,13 +39,13 @@ class TestKucoinFuturesAuthenticatedExchange( EXPECT_MISSING_FEE_IN_CANCELLED_ORDERS = False IS_AUTHENTICATED_REQUEST_CHECK_AVAILABLE = True # set True when is_authenticated_request is implemented EXPECTED_QUOTE_MIN_ORDER_SIZE = 40 + EXPECT_BALANCE_FILTER_BY_MARKET_STATUS = True async def test_get_portfolio(self): await super().test_get_portfolio() async def test_get_portfolio_with_market_filter(self): - # pass if not implemented - pass + await super().test_get_portfolio_with_market_filter() # can have small variations failing the test when positions are open async def test_get_account_id(self): await super().test_get_account_id() From 043132cc967a47bace233427e1bd639d91ce924a Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 29 Dec 2024 11:53:24 +0100 Subject: [PATCH 2/2] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ce0004fa5..79e02b6cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Drakkar-Software requirements OctoBot-Commons==1.9.70 -OctoBot-Trading==2.4.138 +OctoBot-Trading==2.4.139 OctoBot-Evaluators==1.9.7 OctoBot-Tentacles-Manager==2.9.16 OctoBot-Services==1.6.21