From 411e21f430a51d3f36236bd71f81889356a0a701 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 28 Mar 2023 18:13:26 +0200 Subject: [PATCH] Improve stop test --- tests/test_freqtradebot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index adb581252..2033a5518 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -1149,10 +1149,12 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_ canceled_stoploss_order = MagicMock(return_value={'status': 'canceled'}) mocker.patch(f'{EXMS}.fetch_stoploss_order', canceled_stoploss_order) stoploss.reset_mock() + amount_before = trade.amount assert freqtrade.handle_stoploss_on_exchange(trade) is False assert stoploss.call_count == 1 assert trade.stoploss_order_id == "13434334" + assert trade.amount == amount_before # Fourth case: when stoploss is set and it is hit # should unset stoploss_order_id and return true