Copy 'pairs' to pair_whitelist to validate the correct pairs against the
exchange
This commit is contained in:
parent
86ee545a5b
commit
5298ea2c33
@ -31,6 +31,10 @@ def start_download_data(args: Dict[str, Any]) -> None:
|
|||||||
"Downloading data requires a list of pairs. "
|
"Downloading data requires a list of pairs. "
|
||||||
"Please check the documentation on how to configure this.")
|
"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"]}, '
|
logger.info(f'About to download pairs: {config["pairs"]}, '
|
||||||
f'intervals: {config["timeframes"]} to {config["datadir"]}')
|
f'intervals: {config["timeframes"]} to {config["datadir"]}')
|
||||||
|
|
||||||
|
@ -563,6 +563,7 @@ def test_download_data_no_markets(mocker, caplog):
|
|||||||
mocker.patch(
|
mocker.patch(
|
||||||
'freqtrade.exchange.Exchange.markets', PropertyMock(return_value={})
|
'freqtrade.exchange.Exchange.markets', PropertyMock(return_value={})
|
||||||
)
|
)
|
||||||
|
validate_mock = mocker.patch('freqtrade.exchange.Exchange.validate_pairs')
|
||||||
args = [
|
args = [
|
||||||
"download-data",
|
"download-data",
|
||||||
"--exchange", "binance",
|
"--exchange", "binance",
|
||||||
@ -572,6 +573,7 @@ def test_download_data_no_markets(mocker, caplog):
|
|||||||
start_download_data(get_args(args))
|
start_download_data(get_args(args))
|
||||||
assert dl_mock.call_args[1]['timerange'].starttype == "date"
|
assert dl_mock.call_args[1]['timerange'].starttype == "date"
|
||||||
assert log_has("Pairs [ETH/BTC,XRP/BTC] not available on exchange Binance.", caplog)
|
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):
|
def test_download_data_no_exchange(mocker, caplog):
|
||||||
|
Loading…
Reference in New Issue
Block a user