test: adjust rpc tests for new calculation

This commit is contained in:
Matthias
2025-01-18 19:58:23 +01:00
parent 2044af24a3
commit f773905d8e
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -993,7 +993,7 @@ def test_performance_handle(default_conf_usdt, ticker, fee, mocker) -> None:
assert res[0]["pair"] == "NEO/USDT" assert res[0]["pair"] == "NEO/USDT"
assert res[0]["count"] == 1 assert res[0]["count"] == 1
assert res[0]["profit_abs"] == 3.9875 assert res[0]["profit_abs"] == 3.9875
assert res[0]["profit_pct"] == 5.0 assert res[0]["profit_pct"] == 1.99
def test_enter_tag_performance_handle(default_conf, ticker, fee, mocker) -> None: def test_enter_tag_performance_handle(default_conf, ticker, fee, mocker) -> None:
+9 -9
View File
@@ -1166,26 +1166,26 @@ def test_api_performance(botclient, fee):
{ {
"count": 1, "count": 1,
"pair": "NEO/USDT", "pair": "NEO/USDT",
"profit": 5.0, "profit": 1.99,
"profit_pct": 5, "profit_pct": 1.99,
"profit_ratio": 0.05, "profit_ratio": 0.0199375,
"profit_abs": 3.9875, "profit_abs": 3.9875,
}, },
{ {
"count": 1, "count": 1,
"pair": "XRP/USDT", "pair": "XRP/USDT",
"profit": 10.0, "profit": 9.47,
"profit_abs": 2.8425, "profit_abs": 2.8425,
"profit_pct": 10.0, "profit_pct": 9.47,
"profit_ratio": 0.1, "profit_ratio": pytest.approx(0.094749999),
}, },
{ {
"count": 1, "count": 1,
"pair": "LTC/USDT", "pair": "LTC/USDT",
"profit": -20.0, "profit": -20.45,
"profit_abs": -4.09, "profit_abs": -4.09,
"profit_pct": -20.0, "profit_pct": -20.45,
"profit_ratio": -0.2, "profit_ratio": -0.2045,
}, },
] ]
+1 -1
View File
@@ -1591,7 +1591,7 @@ async def test_telegram_performance_handle(default_conf_usdt, update, ticker, fe
await telegram._performance(update=update, context=MagicMock()) await telegram._performance(update=update, context=MagicMock())
assert msg_mock.call_count == 1 assert msg_mock.call_count == 1
assert "Performance" in msg_mock.call_args_list[0][0][0] assert "Performance" in msg_mock.call_args_list[0][0][0]
assert "<code>XRP/USDT\t2.842 USDT (10.00%) (1)</code>" in msg_mock.call_args_list[0][0][0] assert "<code>XRP/USDT\t2.842 USDT (9.47%) (1)</code>" in msg_mock.call_args_list[0][0][0]
async def test_telegram_entry_tag_performance_handle( async def test_telegram_entry_tag_performance_handle(