fix for issue #283

This commit is contained in:
Jean-Baptiste LE STANG
2018-01-02 12:04:47 +01:00
parent 0c11d4443f
commit 52e267e864
2 changed files with 17 additions and 10 deletions

View File

@@ -22,10 +22,12 @@ def whitelist_conf():
def get_health():
return [{'Currency': 'ETH',
'IsActive': True
'IsActive': True,
'BaseVolume' : 42
},
{'Currency': 'TKN',
'IsActive': True
'IsActive': True,
'BaseVolume' : 1664
}]
@@ -44,7 +46,7 @@ def test_refresh_whitelist(mocker):
refreshedwhitelist = refresh_whitelist(conf['exchange']['pair_whitelist'])
whitelist = ['BTC_ETH', 'BTC_TKN']
# Ensure all except those in whitelist are removed
assert set(whitelist) == set(refreshedwhitelist)
assert whitelist == refreshedwhitelist
def test_refresh_whitelist_dynamic(mocker):
@@ -53,9 +55,9 @@ def test_refresh_whitelist_dynamic(mocker):
mocker.patch.multiple('freqtrade.main.exchange',
get_wallet_health=get_health)
# argument: use the whitelist dynamically by exchange-volume
whitelist = ['BTC_ETH', 'BTC_TKN']
whitelist = ['BTC_TKN', 'BTC_ETH']
refreshedwhitelist = refresh_whitelist(whitelist)
assert set(whitelist) == set(refreshedwhitelist)
assert whitelist == refreshedwhitelist
def test_refresh_whitelist_dynamic_empty(mocker):