mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 12:13:57 +00:00
test: add test for api/hyperopt-loss
This commit is contained in:
parent
0bf30aaa6b
commit
0de3c6945b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user