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

@@ -1931,9 +1931,9 @@ def test_get_overall_performance(fee):
@pytest.mark.parametrize(
"is_short,pair,profit",
[
(True, "ETC/BTC", -0.005),
(False, "XRP/BTC", 0.01),
(None, "XRP/BTC", 0.01),
(True, "XRP/BTC", -0.00018780487),
(False, "ETC/BTC", 0.00003860975),
(None, "XRP/BTC", 0.000025203252),
],
)
def test_get_best_pair(fee, is_short, pair, profit):
@@ -1942,9 +1942,9 @@ def test_get_best_pair(fee, is_short, pair, profit):
create_mock_trades(fee, is_short)
res = Trade.get_best_pair()
assert len(res) == 2
assert len(res) == 4
assert res[0] == pair
assert res[1] == profit
assert pytest.approx(res[1]) == profit
@pytest.mark.usefixtures("init_persistence")
@@ -1954,9 +1954,9 @@ def test_get_best_pair_lev(fee):
create_mock_trades_with_leverage(fee)
res = Trade.get_best_pair()
assert len(res) == 2
assert res[0] == "DOGE/BTC"
assert res[1] == 0.1713156134055116
assert len(res) == 4
assert res[0] == "ETC/BTC"
assert pytest.approx(res[1]) == 0.00003860975
@pytest.mark.usefixtures("init_persistence")