test: use object patching instead of direct assignment

This commit is contained in:
Matthias
2025-12-15 07:01:23 +01:00
parent 5800002d42
commit 84e9251fcd
2 changed files with 6 additions and 9 deletions
+1 -3
View File
@@ -42,9 +42,7 @@ def test_fetch_stoploss_order_gate(default_conf, mocker):
def test_cancel_stoploss_order_gate(default_conf, mocker):
exchange = get_patched_exchange(mocker, default_conf, exchange="gate")
cancel_order_mock = MagicMock()
exchange.cancel_order = cancel_order_mock
cancel_order_mock = mocker.patch.object(exchange, "cancel_order")
exchange.cancel_stoploss_order("1234", "ETH/BTC")
assert cancel_order_mock.call_count == 1