diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 98c97ad53..b4b4a3289 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -2189,6 +2189,22 @@ def test_api_exchanges(botclient): } +def test_list_hyperoptloss(botclient, tmp_path): + ftbot, client = botclient + ftbot.config["user_data_dir"] = tmp_path + + rc = client_get(client, f"{BASE_URI}/hyperopt-loss") + assert_response(rc) + response = rc.json() + assert isinstance(response["loss_functions"], list) + assert len(response["loss_functions"]) > 0 + + sharpeloss = [r for r in response["loss_functions"] if r["name"] == "SharpeHyperOptLoss"] + assert len(sharpeloss) == 1 + assert "Sharpe Ratio calculation" in sharpeloss[0]["description"] + assert len([r for r in response["loss_functions"] if r["name"] == "SortinoHyperOptLoss"]) == 1 + + def test_api_freqaimodels(botclient, tmp_path, mocker): ftbot, client = botclient ftbot.config["user_data_dir"] = tmp_path