From e987e0e2a945d8926b07a605caa3d90c77a85392 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Wed, 9 Feb 2022 03:38:25 -0600 Subject: [PATCH] exchange minor fixes --- freqtrade/exchange/exchange.py | 10 +++++----- tests/test_freqtradebot.py | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 4c01ec8b5..14b2da4df 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2269,11 +2269,11 @@ class Exchange: raise OperationalException( "Freqtrade only supports isolated futures for leverage trading") - def get_maintenance_ratio_and_amt( - self, - pair: str, - nominal_value: Optional[float] = 0.0, - ) -> Tuple[float, Optional[float]]: + def get_maintenance_ratio_and_amt( + self, + pair: str, + nominal_value: Optional[float] = 0.0, + ) -> Tuple[float, Optional[float]]: """ :param pair: Market symbol :param nominal_value: The total trade amount in quote currency including leverage diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 649e5bce3..84916622a 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -782,6 +782,10 @@ def test_execute_entry(mocker, default_conf_usdt, fee, limit_order, name=exchange_name, get_maintenance_ratio_and_amt=MagicMock(return_value=(0.01, 0.01)), ) + mocker.patch.multiple( + 'freqtrade.exchange.Okex', + get_max_pair_stake_amount=MagicMock(return_value=500000), + ) pair = 'ETH/USDT' assert not freqtrade.execute_entry(pair, stake_amount, is_short=is_short)