Backtesting: Add the Interval required when data is missing

Change the message:
"No data for pair ETH/BTC, use --refresh-pairs-cached to download the data"
for:
"No data for pair: "ETH/BTC", Interval: 5m. Use --refresh-pairs-cached to download the data"

The message structure is unified with the download message:
"Download the pair: "ETH/BTC", Interval: 5m"
This commit is contained in:
Gerald Lonlas 2018-06-02 13:55:05 -07:00
parent 5e99df1759
commit 127cf5d619
2 changed files with 6 additions and 3 deletions

View File

@ -104,8 +104,10 @@ def load_data(datadir: str,
result[pair] = pairdata
else:
logger.warning(
'No data for pair %s, use --refresh-pairs-cached to download the data',
pair
'No data for pair: "%s", Interval: %s. '
'Use --refresh-pairs-cached to download the data',
pair,
ticker_interval
)
return result

View File

@ -105,7 +105,8 @@ def test_load_data_with_new_pair_1min(ticker_history, mocker, caplog) -> None:
refresh_pairs=False,
pairs=['MEME/BTC'])
assert os.path.isfile(file) is False
assert log_has('No data for pair MEME/BTC, use --refresh-pairs-cached to download the data',
assert log_has('No data for pair: "MEME/BTC", Interval: 1m. '
'Use --refresh-pairs-cached to download the data',
caplog.record_tuples)
# download a new pair if refresh_pairs is set