Add test to cancel sell order

This commit is contained in:
Matthias 2020-05-10 16:24:00 +02:00
parent a2ec18680e
commit 80faa5feb1

View File

@ -2405,6 +2405,21 @@ def test_handle_timedout_limit_sell(mocker, default_conf) -> None:
assert cancel_order_mock.call_count == 1 assert cancel_order_mock.call_count == 1
def test_handle_timedout_limit_sell_cancel_exception(mocker, default_conf) -> None:
patch_RPCManager(mocker)
patch_exchange(mocker)
mocker.patch(
'freqtrade.exchange.Exchange.cancel_order', side_effect=InvalidOrderException())
freqtrade = FreqtradeBot(default_conf)
trade = MagicMock()
order = {'remaining': 1,
'amount': 1,
'status': "open"}
assert freqtrade.handle_timedout_limit_sell(trade, order) == 'error cancelling order'
def test_execute_sell_up(default_conf, ticker, fee, ticker_sell_up, mocker) -> None: def test_execute_sell_up(default_conf, ticker, fee, ticker_sell_up, mocker) -> None:
rpc_mock = patch_RPCManager(mocker) rpc_mock = patch_RPCManager(mocker)
patch_exchange(mocker) patch_exchange(mocker)