Skip to content

Commit 2b729c2

Browse files
committed
test: improve integration test to have proper return value
1 parent 2f990b7 commit 2b729c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/freqtradebot/test_integration.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee,
5050
stoploss_order_mock = MagicMock(side_effect=stop_orders)
5151
# Sell 3rd trade (not called for the first trade)
5252
should_sell_mock = MagicMock(side_effect=[[], [ExitCheckTuple(exit_type=ExitType.EXIT_SIGNAL)]])
53-
cancel_order_mock = MagicMock()
53+
54+
def patch_stoploss(order_id, *args, **kwargs):
55+
slo = stoploss_order_open.copy()
56+
slo["id"] = order_id
57+
slo["status"] = "canceled"
58+
return slo
59+
60+
cancel_order_mock = MagicMock(side_effect=patch_stoploss)
5461
mocker.patch.multiple(
5562
EXMS,
5663
create_stoploss=stoploss,

0 commit comments

Comments
 (0)