Copy 'pairs' to pair_whitelist to validate the correct pairs against the

exchange
This commit is contained in:
Matthias 2020-02-08 10:12:43 +01:00
parent 86ee545a5b
commit 5298ea2c33
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,10 @@ def start_download_data(args: Dict[str, Any]) -> None:
"Downloading data requires a list of pairs. "
"Please check the documentation on how to configure this.")
# Syncronize Pair whitelist and pairs - since 'pair_whitelist' is checked
# against the exchange - but not 'pairs'
config['exchange']['pair_whitelist'] = config['pairs']
logger.info(f'About to download pairs: {config["pairs"]}, '
f'intervals: {config["timeframes"]} to {config["datadir"]}')

View File

@ -563,6 +563,7 @@ def test_download_data_no_markets(mocker, caplog):
mocker.patch(
'freqtrade.exchange.Exchange.markets', PropertyMock(return_value={})
)
validate_mock = mocker.patch('freqtrade.exchange.Exchange.validate_pairs')
args = [
"download-data",
"--exchange", "binance",
@ -572,6 +573,7 @@ def test_download_data_no_markets(mocker, caplog):
start_download_data(get_args(args))
assert dl_mock.call_args[1]['timerange'].starttype == "date"
assert log_has("Pairs [ETH/BTC,XRP/BTC] not available on exchange Binance.", caplog)
assert validate_mock.call_args_list[0][0][0] == ['ETH/BTC', 'XRP/BTC']
def test_download_data_no_exchange(mocker, caplog):