diff --git a/tests/exchange/test_binance.py b/tests/exchange/test_binance.py index d4c98fd63..98e19616d 100644 --- a/tests/exchange/test_binance.py +++ b/tests/exchange/test_binance.py @@ -628,3 +628,12 @@ def test_get_maintenance_ratio_and_amt_binance( exchange._leverage_tiers = leverage_tiers (result_ratio, result_amt) = exchange.get_maintenance_ratio_and_amt(pair, nominal_value) assert (round(result_ratio, 8), round(result_amt, 8)) == (mm_ratio, amt) + + +def test_load_leverage_tiers_binance(mocker, default_conf, leverage_tiers): + # TODO-lev + api_mock = MagicMock() + default_conf['trading_mode'] = 'futures' + default_conf['margin_mode'] = 'isolated' + exchange = get_patched_exchange(mocker, default_conf, api_mock) + assert exchange diff --git a/tests/exchange/test_ccxt_compat.py b/tests/exchange/test_ccxt_compat.py index 0e78a9133..1e3f9972b 100644 --- a/tests/exchange/test_ccxt_compat.py +++ b/tests/exchange/test_ccxt_compat.py @@ -341,6 +341,7 @@ class TestCCXTExchange(): def test_get_max_leverage_futures(self, exchange_futures): futures, futures_name = exchange_futures + # TODO-lev: binance, gateio, and okex test if futures: leverage_in_market_futures = EXCHANGES[futures_name]['leverage_in_market']['futures'] if leverage_in_market_futures: @@ -362,3 +363,18 @@ class TestCCXTExchange(): contract_size = futures._get_contract_size(futures_pair) assert (isinstance(contract_size, float) or isinstance(contract_size, int)) assert contract_size >= 0.0 + + def test_get_liquidation_price_compat(): + return # TODO-lev + + def test_liquidation_price_compat(): + return # TODO-lev + + def test_get_max_pair_stake_amount_compat(): + return # TODO-lev + + def test_load_leverage_tiers_compat(): + return # TODO-lev + + def test_get_maintenance_ratio_and_amt_compat(): + return # TODO-lev diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 9730a9fb4..b447704b3 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -3561,6 +3561,7 @@ def test__ccxt_config( ("TKN/USDT", 210.30, 1.0), ]) def test_get_max_leverage(default_conf, mocker, pair, nominal_value, max_lev): + # TODO-lev: Branch coverage default_conf['trading_mode'] = 'futures' default_conf['margin_mode'] = 'isolated' exchange = get_patched_exchange(mocker, default_conf, id="gateio") @@ -4222,3 +4223,39 @@ def test_get_max_pair_stake_amount( mocker.patch('freqtrade.exchange.Exchange.markets', markets) assert exchange.get_max_pair_stake_amount('BTC/USDT', 2.0) == 20000 assert exchange.get_max_pair_stake_amount('ADA/USDT', 2.0) == 500 + + +def test_load_leverage_tiers(mocker, default_conf, leverage_tiers): + # TODO-lev + api_mock = MagicMock() + default_conf['trading_mode'] = 'futures' + default_conf['margin_mode'] = 'isolated' + exchange = get_patched_exchange(mocker, default_conf, api_mock) + assert exchange + + +def test_parse_leverage_tier(mocker, default_conf, leverage_tiers): + # TODO-lev + api_mock = MagicMock() + default_conf['trading_mode'] = 'futures' + default_conf['margin_mode'] = 'isolated' + exchange = get_patched_exchange(mocker, default_conf, api_mock) + assert exchange + + +def test_get_leverage_tiers_for_pair(mocker, default_conf, leverage_tiers): + # TODO-lev + api_mock = MagicMock() + default_conf['trading_mode'] = 'futures' + default_conf['margin_mode'] = 'isolated' + exchange = get_patched_exchange(mocker, default_conf, api_mock) + assert exchange + + +def test_get_maintenance_ratio_and_amt(mocker, default_conf, leverage_tiers): + # TODO-lev + api_mock = MagicMock() + default_conf['trading_mode'] = 'futures' + default_conf['margin_mode'] = 'isolated' + exchange = get_patched_exchange(mocker, default_conf, api_mock) + assert exchange