Added retrier to exchange functions and reduced failing tests down to 2

This commit is contained in:
Sam Germain
2021-09-04 19:16:17 -06:00
parent aac1094078
commit 61fdf74ad9
4 changed files with 25 additions and 10 deletions

View File

@@ -149,7 +149,7 @@ def test_get_max_leverage_binance(default_conf, mocker, pair, nominal_value, max
def test_fill_leverage_brackets_binance(default_conf, mocker):
api_mock = MagicMock()
api_mock.load_leverage_brackets = MagicMock(return_value={{
api_mock.load_leverage_brackets = MagicMock(return_value={
'ADA/BUSD': [[0.0, '0.025'],
[100000.0, '0.05'],
[500000.0, '0.1'],
@@ -173,7 +173,7 @@ def test_fill_leverage_brackets_binance(default_conf, mocker):
[250000.0, '0.125'],
[1000000.0, '0.5']],
}})
})
exchange = get_patched_exchange(mocker, default_conf, api_mock, id="binance")
assert exchange._leverage_brackets == {

View File

@@ -2998,8 +2998,8 @@ def test_set_leverage(mocker, default_conf, exchange_name, collateral):
exchange_name,
"set_leverage",
"set_leverage",
symbol="XRP/USDT",
collateral=collateral
pair="XRP/USDT",
leverage=5.0
)
@@ -3021,6 +3021,6 @@ def test_set_margin_mode(mocker, default_conf, exchange_name, collateral):
exchange_name,
"set_margin_mode",
"set_margin_mode",
symbol="XRP/USDT",
pair="XRP/USDT",
collateral=collateral
)

View File

@@ -274,7 +274,7 @@ def test_get_max_leverage_kraken(default_conf, mocker, pair, nominal_value, max_
def test_fill_leverage_brackets_kraken(default_conf, mocker):
api_mock = MagicMock()
api_mock.load_markets = MagicMock(return_value={{
api_mock.load_markets = MagicMock(return_value={
"ADA/BTC": {'active': True,
'altname': 'ADAXBT',
'base': 'ADA',
@@ -483,7 +483,7 @@ def test_fill_leverage_brackets_kraken(default_conf, mocker):
[5000000, 0.0012],
[10000000, 0.0001]]}}
}})
})
exchange = get_patched_exchange(mocker, default_conf, api_mock, id="kraken")
assert exchange._leverage_brackets == {