From bc855b2a326f65dda8af50f4c29c00c31f49a358 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Feb 2022 13:00:38 +0100 Subject: [PATCH] Update some missing mocks --- tests/exchange/test_binance.py | 1 + tests/exchange/test_exchange.py | 2 ++ tests/exchange/test_okex.py | 1 + 3 files changed, 4 insertions(+) diff --git a/tests/exchange/test_binance.py b/tests/exchange/test_binance.py index 30ffeeae0..631b7e8c0 100644 --- a/tests/exchange/test_binance.py +++ b/tests/exchange/test_binance.py @@ -593,6 +593,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) diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 032473062..fda3f6ea2 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -4311,6 +4311,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 @@ -4347,6 +4348,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) diff --git a/tests/exchange/test_okex.py b/tests/exchange/test_okex.py index a9f7b8099..f9a93c569 100644 --- a/tests/exchange/test_okex.py +++ b/tests/exchange/test_okex.py @@ -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': [ {