tests: add test for list-hyperoptloss

This commit is contained in:
Matthias
2024-10-22 06:32:11 +02:00
parent 1d5d7048d6
commit faac205464

View File

@@ -21,6 +21,7 @@ from freqtrade.commands import (
start_list_data,
start_list_exchanges,
start_list_freqAI_models,
start_list_hyperopt_loss_functions,
start_list_markets,
start_list_strategies,
start_list_timeframes,
@@ -1055,6 +1056,28 @@ def test_start_list_strategies(capsys):
assert str(Path("broken_strats/broken_futures_strategies.py")) in captured.out
def test_start_list_hyperopt_loss_functions(capsys):
args = ["list-hyperoptloss", "-1"]
pargs = get_args(args)
pargs["config"] = None
start_list_hyperopt_loss_functions(pargs)
captured = capsys.readouterr()
assert "CalmarHyperOptLoss" in captured.out
assert "MaxDrawDownHyperOptLoss" in captured.out
assert "SortinoHyperOptLossDaily" in captured.out
assert "<builtin>/hyperopt_loss_sortino_daily.py" not in captured.out
args = ["list-hyperoptloss"]
pargs = get_args(args)
pargs["config"] = None
start_list_hyperopt_loss_functions(pargs)
captured = capsys.readouterr()
assert "CalmarHyperOptLoss" in captured.out
assert "MaxDrawDownHyperOptLoss" in captured.out
assert "SortinoHyperOptLossDaily" in captured.out
assert "<builtin>/hyperopt_loss_sortino_daily.py" in captured.out
def test_start_list_freqAI_models(capsys):
args = ["list-freqaimodels", "-1"]
pargs = get_args(args)