Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mlguys committed Apr 25, 2024
1 parent ae3a681 commit fd924c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
34 changes: 17 additions & 17 deletions test/hummingbot/connector/exchange/binance/test_binance_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def all_symbols_request_mock_response(self):
"isSpotTradingAllowed": True,
"isMarginTradingAllowed": True,
"filters": [],
"permissions": [
"permissionSets": [[
"SPOT",
"MARGIN"
]
]]
},
]
}
Expand Down Expand Up @@ -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"),
Expand All @@ -176,9 +176,9 @@ def all_symbols_including_invalid_pair_mock_response(self) -> Tuple[str, Any]:
"isSpotTradingAllowed": True,
"isMarginTradingAllowed": True,
"filters": [],
"permissions": [
"permissionSets": [[
"MARGIN"
]
]]
},
]
}
Expand Down Expand Up @@ -226,10 +226,10 @@ def trading_rules_request_mock_response(self):
"minNotional": "0.00100000"
}
],
"permissions": [
"permissionSets": [[
"SPOT",
"MARGIN"
]
]]
}
]
}
Expand All @@ -255,10 +255,10 @@ def trading_rules_request_erroneous_mock_response(self):
"ocoAllowed": True,
"isSpotTradingAllowed": True,
"isMarginTradingAllowed": True,
"permissions": [
"permissionSets": [[
"SPOT",
"MARGIN"
]
]]
}
]
}
Expand Down Expand Up @@ -297,9 +297,9 @@ def balance_request_mock_response_for_base_and_quote(self):
"locked": "0.00000000"
}
],
"permissions": [
"permissionSets": [[
"SPOT"
]
]]
}

@property
Expand All @@ -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
Expand Down Expand Up @@ -1180,9 +1180,9 @@ def test_format_trading_rules__min_notional_present(self):
"minNotional": "0.00100000"
}
],
"permissions": [
"permissionSets": [[
"SPOT"
]
]]
}]
exchange_info = {"symbols": trading_rules}

Expand Down Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit fd924c2

Please sign in to comment.