test: fix hyperliquid positions test
This commit is contained in:
@@ -778,7 +778,7 @@ def test_hyperliquid_fetch_positions_hip3(default_conf, mocker):
|
|||||||
return vntl_positions
|
return vntl_positions
|
||||||
return default_positions
|
return default_positions
|
||||||
|
|
||||||
api_mock.fetch_positions = MagicMock(side_effect=fetch_positions_side_effect)
|
positions_mock = MagicMock(side_effect=fetch_positions_side_effect)
|
||||||
|
|
||||||
default_conf["trading_mode"] = "futures"
|
default_conf["trading_mode"] = "futures"
|
||||||
default_conf["margin_mode"] = "isolated"
|
default_conf["margin_mode"] = "isolated"
|
||||||
@@ -789,9 +789,7 @@ def test_hyperliquid_fetch_positions_hip3(default_conf, mocker):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Mock super().fetch_positions() to return default positions
|
# Mock super().fetch_positions() to return default positions
|
||||||
mocker.patch(
|
mocker.patch(f"{EXMS}.fetch_positions", positions_mock)
|
||||||
"freqtrade.exchange.exchange.Exchange.fetch_positions", return_value=default_positions
|
|
||||||
)
|
|
||||||
|
|
||||||
positions = exchange.fetch_positions()
|
positions = exchange.fetch_positions()
|
||||||
|
|
||||||
@@ -802,7 +800,7 @@ def test_hyperliquid_fetch_positions_hip3(default_conf, mocker):
|
|||||||
assert any(p["symbol"] == "VNTL-SPACEX/USDH:USDH" for p in positions)
|
assert any(p["symbol"] == "VNTL-SPACEX/USDH:USDH" for p in positions)
|
||||||
|
|
||||||
# Verify API calls (xyz + vntl, default is mocked separately)
|
# Verify API calls (xyz + vntl, default is mocked separately)
|
||||||
assert api_mock.fetch_positions.call_count == 2
|
assert positions_mock.call_count == 3
|
||||||
|
|
||||||
|
|
||||||
def test_hyperliquid_market_is_tradable(default_conf, mocker):
|
def test_hyperliquid_market_is_tradable(default_conf, mocker):
|
||||||
|
|||||||
Reference in New Issue
Block a user