Improve test stability by making keys optional in the ccxt test-matrix

This commit is contained in:
Matthias 2022-03-05 14:15:58 +01:00
parent 2b1a8f2fbb
commit 7a545f49af

View File

@ -87,6 +87,7 @@ EXCHANGES = {
'stake_currency': 'USDT', 'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
'futures': False,
}, },
'bitvavo': { 'bitvavo': {
'pair': 'BTC/EUR', 'pair': 'BTC/EUR',
@ -322,7 +323,7 @@ class TestCCXTExchange():
def test_ccxt_get_max_leverage_spot(self, exchange): def test_ccxt_get_max_leverage_spot(self, exchange):
spot, spot_name = exchange spot, spot_name = exchange
if spot: if spot:
leverage_in_market_spot = EXCHANGES[spot_name]['leverage_in_spot_market'] leverage_in_market_spot = EXCHANGES[spot_name].get('leverage_in_spot_market')
if leverage_in_market_spot: if leverage_in_market_spot:
spot_pair = EXCHANGES[spot_name].get('pair', EXCHANGES[spot_name]['pair']) spot_pair = EXCHANGES[spot_name].get('pair', EXCHANGES[spot_name]['pair'])
spot_leverage = spot.get_max_leverage(spot_pair, 20) spot_leverage = spot.get_max_leverage(spot_pair, 20)
@ -332,7 +333,7 @@ class TestCCXTExchange():
def test_ccxt_get_max_leverage_futures(self, exchange_futures): def test_ccxt_get_max_leverage_futures(self, exchange_futures):
futures, futures_name = exchange_futures futures, futures_name = exchange_futures
if futures: if futures:
leverage_tiers_public = EXCHANGES[futures_name]['leverage_tiers_public'] leverage_tiers_public = EXCHANGES[futures_name].get('leverage_tiers_public')
if leverage_tiers_public: if leverage_tiers_public:
futures_pair = EXCHANGES[futures_name].get( futures_pair = EXCHANGES[futures_name].get(
'futures_pair', 'futures_pair',
@ -355,7 +356,7 @@ class TestCCXTExchange():
def test_ccxt_load_leverage_tiers(self, exchange_futures): def test_ccxt_load_leverage_tiers(self, exchange_futures):
futures, futures_name = exchange_futures futures, futures_name = exchange_futures
if futures and EXCHANGES[futures_name]['leverage_tiers_public']: if futures and EXCHANGES[futures_name].get('leverage_tiers_public'):
leverage_tiers = futures.load_leverage_tiers() leverage_tiers = futures.load_leverage_tiers()
futures_pair = EXCHANGES[futures_name].get( futures_pair = EXCHANGES[futures_name].get(
'futures_pair', 'futures_pair',
@ -388,7 +389,7 @@ class TestCCXTExchange():
def test_ccxt_dry_run_liquidation_price(self, exchange_futures): def test_ccxt_dry_run_liquidation_price(self, exchange_futures):
futures, futures_name = exchange_futures futures, futures_name = exchange_futures
if futures and EXCHANGES[futures_name]['leverage_tiers_public']: if futures and EXCHANGES[futures_name].get('leverage_tiers_public'):
futures_pair = EXCHANGES[futures_name].get( futures_pair = EXCHANGES[futures_name].get(
'futures_pair', 'futures_pair',