Merge branch 'leverage-tiers' of https://github.com/samgermain/freqtrade into leverage-tiers

This commit is contained in:
Sam Germain
2022-02-14 09:40:53 -06:00
6 changed files with 12 additions and 7 deletions

View File

@@ -592,6 +592,7 @@ def test_get_maintenance_ratio_and_amt_binance(
mm_ratio,
amt,
):
mocker.patch('freqtrade.exchange.Exchange.exchange_has', return_value=True)
exchange = get_patched_exchange(mocker, default_conf, id="binance")
exchange._leverage_tiers = leverage_tiers
(result_ratio, result_amt) = exchange.get_maintenance_ratio_and_amt(pair, nominal_value)

View File

@@ -4312,6 +4312,7 @@ def test_get_maintenance_ratio_and_amt_exceptions(mocker, default_conf, leverage
api_mock = MagicMock()
default_conf['trading_mode'] = 'futures'
default_conf['margin_mode'] = 'isolated'
mocker.patch('freqtrade.exchange.Exchange.exchange_has', return_value=True)
exchange = get_patched_exchange(mocker, default_conf, api_mock)
exchange._leverage_tiers = leverage_tiers
@@ -4348,6 +4349,7 @@ def test_get_maintenance_ratio_and_amt(
api_mock = MagicMock()
default_conf['trading_mode'] = 'futures'
default_conf['margin_mode'] = 'isolated'
mocker.patch('freqtrade.exchange.Exchange.exchange_has', return_value=True)
exchange = get_patched_exchange(mocker, default_conf, api_mock)
exchange.get_maintenance_ratio_and_amt(pair, value) == (mmr, maintAmt)

View File

@@ -13,6 +13,7 @@ def test_get_maintenance_ratio_and_amt_okx(
default_conf['dry_run'] = False
mocker.patch.multiple(
'freqtrade.exchange.Okx',
exchange_has=MagicMock(return_value=True),
load_leverage_tiers=MagicMock(return_value={
'ETH/USDT:USDT': [
{