Add test for precision_remove ...

BTT should not be in the list when that is enabled.
This commit is contained in:
Matthias 2019-03-03 15:31:48 +01:00
parent e2cbb7e7da
commit 3c5deb9aaf
2 changed files with 11 additions and 0 deletions

View File

@ -667,6 +667,7 @@ def tickers():
'vwap': 0.01869197,
'open': 0.018585,
'close': 0.018573,
'last': 0.018799,
'baseVolume': 81058.66,
'quoteVolume': 2247.48374509,
},

View File

@ -113,6 +113,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, markets, tickers)
freqtrade = get_patched_freqtradebot(mocker, whitelist_conf)
mocker.patch('freqtrade.exchange.Exchange.get_markets', markets)
mocker.patch('freqtrade.exchange.Exchange.get_tickers', tickers)
mocker.patch('freqtrade.exchange.Exchange.symbol_price_prec', lambda s, p, r: round(r, 8))
# Test to retrieved BTC sorted on quoteVolume (default)
whitelist = freqtrade.pairlists._gen_pair_whitelist(base_currency='BTC', key='quoteVolume')
@ -132,6 +133,15 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, markets, tickers)
whitelist = freqtrade.pairlists._gen_pair_whitelist(base_currency='ETH', key='quoteVolume')
assert whitelist == []
freqtrade.pairlists._precision_filter = True
freqtrade.config['stake_currency'] = 'BTC'
# Retest First 2 test-cases to make sure BTT is not in it (too low priced)
whitelist = freqtrade.pairlists._gen_pair_whitelist(base_currency='BTC', key='quoteVolume')
assert whitelist == ['ETH/BTC', 'TKN/BTC']
whitelist = freqtrade.pairlists._gen_pair_whitelist(base_currency='BTC', key='bidVolume')
assert whitelist == ['TKN/BTC', 'ETH/BTC']
def test_gen_pair_whitelist_not_supported(mocker, default_conf, tickers) -> None:
default_conf['pairlist'] = {'method': 'VolumePairList',