Improve variable naming in test

This commit is contained in:
Matthias 2023-09-21 20:58:58 +02:00
parent 8ccc66cd97
commit b21775142d

View File

@ -3335,11 +3335,11 @@ def test_handle_cancel_enter(mocker, caplog, default_conf_usdt, limit_order, is_
patch_RPCManager(mocker)
patch_exchange(mocker)
l_order = deepcopy(limit_order[entry_side(is_short)])
cancel_buy_order = deepcopy(limit_order[entry_side(is_short)])
cancel_buy_order['status'] = 'canceled'
del cancel_buy_order['filled']
cancel_entry_order = deepcopy(limit_order[entry_side(is_short)])
cancel_entry_order['status'] = 'canceled'
del cancel_entry_order['filled']
cancel_order_mock = MagicMock(return_value=cancel_buy_order)
cancel_order_mock = MagicMock(return_value=cancel_entry_order)
mocker.patch(f'{EXMS}.cancel_order_with_result', cancel_order_mock)
freqtrade = FreqtradeBot(default_conf_usdt)
@ -3369,8 +3369,8 @@ def test_handle_cancel_enter(mocker, caplog, default_conf_usdt, limit_order, is_
assert cancel_order_mock.call_count == 1
# Order remained open for some reason (cancel failed)
cancel_buy_order['status'] = 'open'
cancel_order_mock = MagicMock(return_value=cancel_buy_order)
cancel_entry_order['status'] = 'open'
cancel_order_mock = MagicMock(return_value=cancel_entry_order)
mocker.patch(f'{EXMS}.cancel_order_with_result', cancel_order_mock)
assert not freqtrade.handle_cancel_enter(trade, l_order, trade.open_orders_ids[0], reason)
@ -3395,8 +3395,6 @@ def test_handle_cancel_enter(mocker, caplog, default_conf_usdt, limit_order, is_
assert fo_mock.call_count == 3
@pytest.mark.parametrize("is_short", [False, True])
@pytest.mark.parametrize("limit_buy_order_canceled_empty", ['binance', 'kraken', 'bittrex'],
indirect=['limit_buy_order_canceled_empty'])