fixed tests

This commit is contained in:
Sam Germain 2022-02-16 04:52:26 -06:00
parent 3fe0e13bb1
commit 1f3d3d87f6

View File

@ -3500,11 +3500,10 @@ def test_set_margin_mode(mocker, default_conf, margin_mode):
("okx", TradingMode.FUTURES, MarginMode.CROSS, True),
("binance", TradingMode.FUTURES, MarginMode.ISOLATED, False),
# ("gateio", TradingMode.FUTURES, MarginMode.ISOLATED, False),
("gateio", TradingMode.FUTURES, MarginMode.ISOLATED, False),
("okx", TradingMode.FUTURES, MarginMode.ISOLATED, False),
# * Remove once implemented
("gateio", TradingMode.FUTURES, MarginMode.ISOLATED, True),
("binance", TradingMode.MARGIN, MarginMode.CROSS, True),
("binance", TradingMode.FUTURES, MarginMode.CROSS, True),
("kraken", TradingMode.MARGIN, MarginMode.CROSS, True),
@ -4274,10 +4273,17 @@ def test_load_leverage_tiers(mocker, default_conf, leverage_tiers):
exchange = get_patched_exchange(mocker, default_conf, api_mock)
assert exchange.load_leverage_tiers() == {}
# FUTURES
# FUTURES has.fetchLeverageTiers == False
default_conf['trading_mode'] = 'futures'
default_conf['margin_mode'] = 'isolated'
exchange = get_patched_exchange(mocker, default_conf, api_mock)
type(api_mock).has = PropertyMock(return_value={'fetchLeverageTiers': False})
exchange = get_patched_exchange(mocker, default_conf, api_mock)
assert exchange.load_leverage_tiers() == {}
# FUTURES regular
type(api_mock).has = PropertyMock(return_value={'fetchLeverageTiers': True})
exchange = get_patched_exchange(mocker, default_conf, api_mock)
assert exchange.load_leverage_tiers() == {
'ADA/USDT:USDT': [
{