test_get_markets created debugging param test_comment

This commit is contained in:
Sam Germain 2022-02-14 09:24:42 -06:00
parent 8fe3f0c933
commit 16e38592a9

View File

@ -2988,7 +2988,7 @@ def test_get_valid_pair_combination(default_conf, mocker, markets):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"base_currencies,quote_currencies,tradable_only,active_only,spot_only," "base_currencies,quote_currencies,tradable_only,active_only,spot_only,"
"futures_only,expected_keys", [ "futures_only,expected_keys,test_comment", [
# Testing markets (in conftest.py): # Testing markets (in conftest.py):
# 'BLK/BTC': 'active': True # 'BLK/BTC': 'active': True
# 'BTT/BTC': 'active': True # 'BTT/BTC': 'active': True
@ -3002,64 +3002,65 @@ def test_get_valid_pair_combination(default_conf, mocker, markets):
# 'TKN/BTC': 'active' not set # 'TKN/BTC': 'active' not set
# 'XLTCUSDT': 'active': True, not a pair # 'XLTCUSDT': 'active': True, not a pair
# 'XRP/BTC': 'active': False # 'XRP/BTC': 'active': False
# all markets
([], [], False, False, False, False, ([], [], False, False, False, False,
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', ['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD',
'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']), 'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC'],
# all markets, only spot pairs 'all markets'),
([], [], False, False, True, False, ([], [], False, False, True, False,
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', ['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD',
'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']), 'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC'],
# active markets 'all markets, only spot pairs'),
([], [], False, True, False, False, ([], [], False, True, False, False,
['BLK/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'NEO/BTC', ['BLK/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'NEO/BTC',
'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']), 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC'],
# all pairs 'active markets'),
([], [], True, False, False, False, ([], [], True, False, False, False,
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', ['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD',
'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']), 'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC'],
# active pairs 'all pairs'),
([], [], True, True, False, False, ([], [], True, True, False, False,
['BLK/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'NEO/BTC', ['BLK/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'NEO/BTC',
'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']), 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC'],
# all markets, base=ETH, LTC 'active pairs'),
(['ETH', 'LTC'], [], False, False, False, False, (['ETH', 'LTC'], [], False, False, False, False,
['ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']), ['ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT'],
# all markets, base=LTC 'all markets, base=ETH, LTC'),
(['LTC'], [], False, False, False, False, (['LTC'], [], False, False, False, False,
['LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']), ['LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT'],
# spot markets, base=LTC 'all markets, base=LTC'),
(['LTC'], [], False, False, True, False, (['LTC'], [], False, False, True, False,
['LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']), ['LTC/BTC', 'LTC/ETH', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT'],
# all markets, quote=USDT 'spot markets, base=LTC'),
([], ['USDT'], False, False, False, False, ([], ['USDT'], False, False, False, False,
['ETH/USDT', 'LTC/USDT', 'XLTCUSDT']), ['ETH/USDT', 'LTC/USDT', 'XLTCUSDT'],
# Futures markets, quote=USDT 'all markets, quote=USDT'),
([], ['USDT'], False, False, False, True, ([], ['USDT'], False, False, False, True,
['ETH/USDT', 'LTC/USDT']), ['ETH/USDT', 'LTC/USDT'],
# all markets, quote=USDT, USD 'Futures markets, quote=USDT'),
([], ['USDT', 'USD'], False, False, False, False, ([], ['USDT', 'USD'], False, False, False, False,
['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']), ['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT'],
# spot markets, quote=USDT, USD 'all markets, quote=USDT, USD'),
([], ['USDT', 'USD'], False, False, True, False, ([], ['USDT', 'USD'], False, False, True, False,
['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']), ['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT'],
# all markets, base=LTC, quote=USDT 'spot markets, quote=USDT, USD'),
(['LTC'], ['USDT'], False, False, False, False, (['LTC'], ['USDT'], False, False, False, False,
['LTC/USDT', 'XLTCUSDT']), ['LTC/USDT', 'XLTCUSDT'],
# all pairs, base=LTC, quote=USDT 'all markets, base=LTC, quote=USDT'),
(['LTC'], ['USDT'], True, False, False, False, (['LTC'], ['USDT'], True, False, False, False,
['LTC/USDT', 'XLTCUSDT']), ['LTC/USDT', 'XLTCUSDT'],
# all markets, base=LTC, quote=USDT, NONEXISTENT 'all pairs, base=LTC, quote=USDT'),
(['LTC'], ['USDT', 'NONEXISTENT'], False, False, False, False, (['LTC'], ['USDT', 'NONEXISTENT'], False, False, False, False,
['LTC/USDT', 'XLTCUSDT']), ['LTC/USDT', 'XLTCUSDT'],
# all markets, base=LTC, quote=NONEXISTENT 'all markets, base=LTC, quote=USDT, NONEXISTENT'),
(['LTC'], ['NONEXISTENT'], False, False, False, False, (['LTC'], ['NONEXISTENT'], False, False, False, False,
[]), [],
'all markets, base=LTC, quote=NONEXISTENT'),
]) ])
def test_get_markets(default_conf, mocker, markets_static, def test_get_markets(default_conf, mocker, markets_static,
base_currencies, quote_currencies, tradable_only, active_only, base_currencies, quote_currencies, tradable_only, active_only,
spot_only, futures_only, spot_only, futures_only, expected_keys,
expected_keys): test_comment # Here for debugging purposes (Not used within method)
):
mocker.patch.multiple('freqtrade.exchange.Exchange', mocker.patch.multiple('freqtrade.exchange.Exchange',
_init_ccxt=MagicMock(return_value=MagicMock()), _init_ccxt=MagicMock(return_value=MagicMock()),
_load_async_markets=MagicMock(), _load_async_markets=MagicMock(),