Skip to content

Commit 1e33ea0

Browse files
authored
Merge pull request freqtrade#12890 from hamadbinghalib/fix/download-data-convert-log-format
fix(configuration): avoid format-string IndexError for --convert in download-data
2 parents f92c66d + da0e391 commit 1e33ea0

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

freqtrade/configuration/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def _process_plot_options(self, config: Config) -> None:
410410
("include_inactive", "Detected --include-inactive-pairs: {}"),
411411
("no_parallel_download", "Detected --no-parallel-download: {}"),
412412
("download_trades", "Detected --dl-trades: {}"),
413-
("convert_trades", "Detected --convert: {} - Converting Trade data to OHCV {}"),
413+
("convert_trades", "Detected --convert: {} - Converting trade data to OHLCV."),
414414
("dataformat_ohlcv", 'Using "{}" to store OHLCV data.'),
415415
("dataformat_trades", 'Using "{}" to store trades data.'),
416416
("show_timerange", "Detected --show-timerange"),

tests/commands/test_commands.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ def test_setup_utils_configuration():
8383
assert config["dry_run"] is False
8484

8585

86+
def test_setup_utils_configuration_download_convert_flag():
87+
args = [
88+
"download-data",
89+
"--exchange",
90+
"kraken",
91+
"--pairs",
92+
"ETH/USDT",
93+
"--dl-trades",
94+
"--convert",
95+
"-t",
96+
"1m",
97+
"--timerange",
98+
"20260101-",
99+
"--config",
100+
"tests/testdata/testconfigs/main_test_config.json",
101+
]
102+
103+
config = setup_utils_configuration(get_args(args), RunMode.UTIL_EXCHANGE)
104+
105+
assert config["download_trades"] is True
106+
assert config["convert_trades"] is True
107+
assert config["timeframes"] == ["1m"]
108+
109+
86110
def test_start_trading_fail(mocker, caplog):
87111
mocker.patch("freqtrade.worker.Worker.run", MagicMock(side_effect=OperationalException))
88112

0 commit comments

Comments
 (0)