From fd924c2239295482ed43ab8b42c1e81ce7137060 Mon Sep 17 00:00:00 2001 From: mlguys Date: Thu, 25 Apr 2024 17:08:16 +0700 Subject: [PATCH] update test cases --- .../exchange/binance/test_binance_exchange.py | 34 +++++++++---------- .../exchange/binance/test_binance_utils.py | 8 ++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/hummingbot/connector/exchange/binance/test_binance_exchange.py b/test/hummingbot/connector/exchange/binance/test_binance_exchange.py index 37fd9b979b..3d713bcf68 100644 --- a/test/hummingbot/connector/exchange/binance/test_binance_exchange.py +++ b/test/hummingbot/connector/exchange/binance/test_binance_exchange.py @@ -84,10 +84,10 @@ def all_symbols_request_mock_response(self): "isSpotTradingAllowed": True, "isMarginTradingAllowed": True, "filters": [], - "permissions": [ + "permissionSets": [[ "SPOT", "MARGIN" - ] + ]] }, ] } @@ -149,9 +149,9 @@ def all_symbols_including_invalid_pair_mock_response(self) -> Tuple[str, Any]: "isSpotTradingAllowed": True, "isMarginTradingAllowed": True, "filters": [], - "permissions": [ + "permissionSets": [[ "MARGIN" - ] + ]] }, { "symbol": self.exchange_symbol_for_tokens("INVALID", "PAIR"), @@ -176,9 +176,9 @@ def all_symbols_including_invalid_pair_mock_response(self) -> Tuple[str, Any]: "isSpotTradingAllowed": True, "isMarginTradingAllowed": True, "filters": [], - "permissions": [ + "permissionSets": [[ "MARGIN" - ] + ]] }, ] } @@ -226,10 +226,10 @@ def trading_rules_request_mock_response(self): "minNotional": "0.00100000" } ], - "permissions": [ + "permissionSets": [[ "SPOT", "MARGIN" - ] + ]] } ] } @@ -255,10 +255,10 @@ def trading_rules_request_erroneous_mock_response(self): "ocoAllowed": True, "isSpotTradingAllowed": True, "isMarginTradingAllowed": True, - "permissions": [ + "permissionSets": [[ "SPOT", "MARGIN" - ] + ]] } ] } @@ -297,9 +297,9 @@ def balance_request_mock_response_for_base_and_quote(self): "locked": "0.00000000" } ], - "permissions": [ + "permissionSets": [[ "SPOT" - ] + ]] } @property @@ -315,7 +315,7 @@ def balance_request_mock_response_only_base(self): "updateTime": 123456789, "accountType": "SPOT", "balances": [{"asset": self.base_asset, "free": "10.0", "locked": "5.0"}], - "permissions": ["SPOT"], + "permissionSets": [["SPOT"]], } @property @@ -1180,9 +1180,9 @@ def test_format_trading_rules__min_notional_present(self): "minNotional": "0.00100000" } ], - "permissions": [ + "permissionSets": [[ "SPOT" - ] + ]] }] exchange_info = {"symbols": trading_rules} @@ -1217,9 +1217,9 @@ def test_format_trading_rules__notional_but_no_min_notional_present(self): "avgPriceMins": 5 } ], - "permissions": [ + "permissionSets": [[ "SPOT" - ] + ]] }] exchange_info = {"symbols": trading_rules} diff --git a/test/hummingbot/connector/exchange/binance/test_binance_utils.py b/test/hummingbot/connector/exchange/binance/test_binance_utils.py index 40c9666bd5..4ab8c14fa5 100644 --- a/test/hummingbot/connector/exchange/binance/test_binance_utils.py +++ b/test/hummingbot/connector/exchange/binance/test_binance_utils.py @@ -17,28 +17,28 @@ def setUpClass(cls) -> None: def test_is_exchange_information_valid(self): invalid_info_1 = { "status": "BREAK", - "permissions": ["MARGIN"], + "permissionSets": [["MARGIN"]], } self.assertFalse(utils.is_exchange_information_valid(invalid_info_1)) invalid_info_2 = { "status": "BREAK", - "permissions": ["SPOT"], + "permissionSets": [["SPOT"]], } self.assertFalse(utils.is_exchange_information_valid(invalid_info_2)) invalid_info_3 = { "status": "TRADING", - "permissions": ["MARGIN"], + "permissionSets": [["MARGIN"]], } self.assertFalse(utils.is_exchange_information_valid(invalid_info_3)) invalid_info_4 = { "status": "TRADING", - "permissions": ["SPOT"], + "permissionSets": [["SPOT"]], } self.assertTrue(utils.is_exchange_information_valid(invalid_info_4))