test: Add test scenario for partially filled exit

* followed by exit_timeout_count
* shouldn't place order for the full amount

part of #12343
pull/12347/head
Matthias 5 months ago
parent 96c65dacdd
commit ca4e4efeb8

@ -2267,6 +2267,18 @@ def test_manage_open_orders_exit_usercustom(
freqtrade.manage_open_orders()
assert log_has_re("Emergency exiting trade.*", caplog)
assert et_mock.call_count == 1
# Full exit
assert et_mock.call_args_list[0][1]["sub_trade_amt"] == 30
et_mock.reset_mock()
# Full partially filled order
# Only places the order for the remaining amount
limit_sell_order_old["remaining"] = open_trade_usdt.amount - 10
freqtrade.manage_open_orders()
assert log_has_re("Emergency exiting trade.*", caplog)
assert et_mock.call_count == 1
assert et_mock.call_args_list[0][1]["sub_trade_amt"] == 20.0
@pytest.mark.parametrize("is_short", [False, True])

Loading…
Cancel
Save