Fetch 2ndary stoploss order once the order triggered.
This commit is contained in:
@@ -53,6 +53,25 @@ def test_fetch_stoploss_order_gateio(default_conf, mocker):
|
||||
assert fetch_order_mock.call_args_list[0][1]['pair'] == 'ETH/BTC'
|
||||
assert fetch_order_mock.call_args_list[0][1]['params'] == {'stop': True}
|
||||
|
||||
default_conf['trading_mode'] = 'futures'
|
||||
default_conf['margin_mode'] = 'isolated'
|
||||
|
||||
exchange = get_patched_exchange(mocker, default_conf, id='gateio')
|
||||
|
||||
exchange.fetch_order = MagicMock(return_value={
|
||||
'status': 'closed',
|
||||
'id': '1234',
|
||||
'stopPrice': 5.62,
|
||||
'info': {
|
||||
'trade_id': '222555'
|
||||
}
|
||||
})
|
||||
|
||||
exchange.fetch_stoploss_order('1234', 'ETH/BTC')
|
||||
assert exchange.fetch_order.call_count == 2
|
||||
assert exchange.fetch_order.call_args_list[0][1]['order_id'] == '1234'
|
||||
assert exchange.fetch_order.call_args_list[1][1]['order_id'] == '222555'
|
||||
|
||||
|
||||
def test_cancel_stoploss_order_gateio(default_conf, mocker):
|
||||
exchange = get_patched_exchange(mocker, default_conf, id='gateio')
|
||||
|
Reference in New Issue
Block a user