test: update tests for new best-pair logic

This commit is contained in:
Matthias
2025-01-26 22:55:17 +01:00
parent 99b2857d3d
commit cf563c1a56
4 changed files with 26 additions and 22 deletions

View File

@@ -963,9 +963,10 @@ def test_api_edge_disabled(botclient, mocker, ticker, fee, markets):
(
True,
{
"best_pair": "ETC/BTC",
"best_rate": -0.5,
"best_pair_profit_ratio": -0.005,
"best_pair": "XRP/BTC",
"best_rate": -0.02,
"best_pair_profit_ratio": -0.00018780487,
"best_pair_profit_abs": -0.001155,
"profit_all_coin": 15.382312,
"profit_all_fiat": 189894.6470718,
"profit_all_percent_mean": 49.62,
@@ -994,9 +995,10 @@ def test_api_edge_disabled(botclient, mocker, ticker, fee, markets):
(
False,
{
"best_pair": "XRP/BTC",
"best_rate": 1.0,
"best_pair_profit_ratio": 0.01,
"best_pair": "ETC/BTC",
"best_rate": 0.0,
"best_pair_profit_ratio": 0.00003860975,
"best_pair_profit_abs": 0.000584127,
"profit_all_coin": -15.46546305,
"profit_all_fiat": -190921.14135225,
"profit_all_percent_mean": -49.62,
@@ -1026,8 +1028,9 @@ def test_api_edge_disabled(botclient, mocker, ticker, fee, markets):
None,
{
"best_pair": "XRP/BTC",
"best_rate": 1.0,
"best_pair_profit_ratio": 0.01,
"best_rate": 0.0,
"best_pair_profit_ratio": 0.000025203252,
"best_pair_profit_abs": 0.000155,
"profit_all_coin": -14.87167525,
"profit_all_fiat": -183590.83096125,
"profit_all_percent_mean": 0.13,
@@ -1080,7 +1083,8 @@ def test_api_profit(botclient, mocker, ticker, fee, markets, is_short, expected)
assert rc.json() == {
"avg_duration": ANY,
"best_pair": expected["best_pair"],
"best_pair_profit_ratio": expected["best_pair_profit_ratio"],
"best_pair_profit_ratio": pytest.approx(expected["best_pair_profit_ratio"]),
"best_pair_profit_abs": expected["best_pair_profit_abs"],
"best_rate": expected["best_rate"],
"first_trade_date": ANY,
"first_trade_humanized": ANY,