From faac205464a25d5d5b6b0e4a23d2ee59d38ed1d2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 22 Oct 2024 06:32:11 +0200 Subject: [PATCH] tests: add test for list-hyperoptloss --- tests/commands/test_commands.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 811513345..28baffd5a 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -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 "/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 "/hyperopt_loss_sortino_daily.py" in captured.out + + def test_start_list_freqAI_models(capsys): args = ["list-freqaimodels", "-1"] pargs = get_args(args)