mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-05-03 23:36:51 +00:00
test: update tests for new best-pair logic
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user