Merge pull request #12890 from hamadbinghalib/fix/download-data-convert-log-format

fix(configuration): avoid format-string IndexError for --convert in download-data
This commit is contained in:
Matthias
2026-03-04 07:01:38 +01:00
committed by GitHub
2 changed files with 25 additions and 1 deletions

View File

@@ -410,7 +410,7 @@ class Configuration:
("include_inactive", "Detected --include-inactive-pairs: {}"),
("no_parallel_download", "Detected --no-parallel-download: {}"),
("download_trades", "Detected --dl-trades: {}"),
("convert_trades", "Detected --convert: {} - Converting Trade data to OHCV {}"),
("convert_trades", "Detected --convert: {} - Converting trade data to OHLCV."),
("dataformat_ohlcv", 'Using "{}" to store OHLCV data.'),
("dataformat_trades", 'Using "{}" to store trades data.'),
("show_timerange", "Detected --show-timerange"),

View File

@@ -83,6 +83,30 @@ def test_setup_utils_configuration():
assert config["dry_run"] is False
def test_setup_utils_configuration_download_convert_flag():
args = [
"download-data",
"--exchange",
"kraken",
"--pairs",
"ETH/USDT",
"--dl-trades",
"--convert",
"-t",
"1m",
"--timerange",
"20260101-",
"--config",
"tests/testdata/testconfigs/main_test_config.json",
]
config = setup_utils_configuration(get_args(args), RunMode.UTIL_EXCHANGE)
assert config["download_trades"] is True
assert config["convert_trades"] is True
assert config["timeframes"] == ["1m"]
def test_start_trading_fail(mocker, caplog):
mocker.patch("freqtrade.worker.Worker.run", MagicMock(side_effect=OperationalException))