fix: ensure handle_onexchange_order works without false warnings

futures were not properly handled in this command.

closes #10533
This commit is contained in:
Matthias
2024-08-14 21:18:47 +02:00
parent 23510c80be
commit 331159a3d8
4 changed files with 21 additions and 2 deletions
+4
View File
@@ -65,6 +65,7 @@ def test_sync_wallet_at_boot(mocker, default_conf):
assert freqtrade.wallets.get_free("GAS") == 0.270739
assert freqtrade.wallets.get_used("GAS") == 0.1
assert freqtrade.wallets.get_total("GAS") == 0.260439
assert freqtrade.wallets.get_owned("GAS/USDT", "GAS") == 0.260439
update_mock = mocker.patch("freqtrade.wallets.Wallets._update_live")
freqtrade.wallets.update(False)
assert update_mock.call_count == 0
@@ -74,6 +75,7 @@ def test_sync_wallet_at_boot(mocker, default_conf):
assert freqtrade.wallets.get_free("NOCURRENCY") == 0
assert freqtrade.wallets.get_used("NOCURRENCY") == 0
assert freqtrade.wallets.get_total("NOCURRENCY") == 0
assert freqtrade.wallets.get_owned("NOCURRENCY/USDT", "NOCURRENCY") == 0
def test_sync_wallet_missing_data(mocker, default_conf):
@@ -336,6 +338,8 @@ def test_sync_wallet_futures_live(mocker, default_conf):
assert "USDT" in freqtrade.wallets._wallets
assert "ETH/USDT:USDT" in freqtrade.wallets._positions
assert freqtrade.wallets._last_wallet_refresh is not None
assert freqtrade.wallets.get_owned("ETH/USDT:USDT", "ETH") == 1000
assert freqtrade.wallets.get_owned("SOL/USDT:USDT", "SOL") == 0
# Remove ETH/USDT:USDT position
del mock_result[0]