Merge branch 'develop' into fut/stop_price_type

This commit is contained in:
Matthias
2023-02-09 20:02:59 +01:00
25 changed files with 263 additions and 131 deletions

View File

@@ -522,8 +522,15 @@ def test__set_leverage_binance(mocker, default_conf):
api_mock.set_leverage = MagicMock()
type(api_mock).has = PropertyMock(return_value={'setLeverage': True})
default_conf['dry_run'] = False
exchange = get_patched_exchange(mocker, default_conf, id="binance")
exchange._set_leverage(3.0, trading_mode=TradingMode.MARGIN)
default_conf['trading_mode'] = TradingMode.FUTURES
default_conf['margin_mode'] = MarginMode.ISOLATED
exchange = get_patched_exchange(mocker, default_conf, api_mock, id="binance")
exchange._set_leverage(3.2, 'BTC/USDT:USDT')
assert api_mock.set_leverage.call_count == 1
# Leverage is rounded to 3.
assert api_mock.set_leverage.call_args_list[0][1]['leverage'] == 3
assert api_mock.set_leverage.call_args_list[0][1]['symbol'] == 'BTC/USDT:USDT'
ccxt_exceptionhandlers(
mocker,

View File

@@ -468,9 +468,13 @@ class TestCCXTExchange():
def test_ccxt__async_get_candle_history(self, exchange: EXCHANGE_FIXTURE_TYPE):
exc, exchangename = exchange
# For some weired reason, this test returns random lengths for bittrex.
if not exc._ft_has['ohlcv_has_history'] or exchangename in ('bittrex'):
return
if exchangename in ('binanceus', 'bittrex'):
# TODO: reenable binanceus test once downtime "ages out" (2023-02-06)
# For some weired reason, this test returns random lengths for bittrex.
pytest.skip("Exchange doesn't provide stable ohlcv history")
if not exc._ft_has['ohlcv_has_history']:
pytest.skip("Exchange does not support candle history")
pair = EXCHANGES[exchangename]['pair']
timeframe = EXCHANGES[exchangename]['timeframe']
self.ccxt__async_get_candle_history(