From 2806110869e7c1f08b411fb215ade1d332e35c6f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 10 Jun 2023 16:41:37 +0200 Subject: [PATCH] Add explicit test for okx cancel_stop --- tests/exchange/test_okx.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/exchange/test_okx.py b/tests/exchange/test_okx.py index 378466ae4..aaffff1df 100644 --- a/tests/exchange/test_okx.py +++ b/tests/exchange/test_okx.py @@ -596,3 +596,15 @@ def test_stoploss_adjust_okx(mocker, default_conf, sl1, sl2, sl3, side): } assert exchange.stoploss_adjust(sl1, order, side=side) assert not exchange.stoploss_adjust(sl2, order, side=side) + + +def test_stoploss_cancel_okx(mocker, default_conf): + exchange = get_patched_exchange(mocker, default_conf, id='okx') + + exchange.cancel_order = MagicMock() + + exchange.cancel_stoploss_order('1234', 'ETH/USDT') + assert exchange.cancel_order.call_count == 1 + assert exchange.cancel_order.call_args_list[0][1]['order_id'] == '1234' + assert exchange.cancel_order.call_args_list[0][1]['pair'] == 'ETH/USDT' + assert exchange.cancel_order.call_args_list[0][1]['params'] == {'stop': True}