updated for PR #6653

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2022-04-06 07:05:43 +05:30
parent 5fa96174e1
commit 28f4a3b373
10 changed files with 40 additions and 32 deletions

View File

@@ -1075,7 +1075,7 @@ def test_api_whitelist(botclient):
@pytest.mark.parametrize('endpoint', [
'forcebuy',
'forceenter',
'force_enter',
])
def test_api_force_entry(botclient, mocker, fee, endpoint):
ftbot, client = botclient

View File

@@ -1231,7 +1231,7 @@ def test_forcesell_handle_invalid(default_conf, update, mocker) -> None:
assert 'invalid argument' in msg_mock.call_args_list[0][0][0]
def test_forceenter_handle(default_conf, update, mocker) -> None:
def test_force_enter_handle(default_conf, update, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
fbuy_mock = MagicMock(return_value=None)
@@ -1243,7 +1243,7 @@ def test_forceenter_handle(default_conf, update, mocker) -> None:
# /forcelong ETH/BTC
context = MagicMock()
context.args = ["ETH/BTC"]
telegram._forceenter(update=update, context=context, order_side=SignalDirection.LONG)
telegram._force_enter(update=update, context=context, order_side=SignalDirection.LONG)
assert fbuy_mock.call_count == 1
assert fbuy_mock.call_args_list[0][0][0] == 'ETH/BTC'
@@ -1256,7 +1256,7 @@ def test_forceenter_handle(default_conf, update, mocker) -> None:
# /forcelong ETH/BTC 0.055
context = MagicMock()
context.args = ["ETH/BTC", "0.055"]
telegram._forceenter(update=update, context=context, order_side=SignalDirection.LONG)
telegram._force_enter(update=update, context=context, order_side=SignalDirection.LONG)
assert fbuy_mock.call_count == 1
assert fbuy_mock.call_args_list[0][0][0] == 'ETH/BTC'
@@ -1264,20 +1264,20 @@ def test_forceenter_handle(default_conf, update, mocker) -> None:
assert fbuy_mock.call_args_list[0][0][1] == 0.055
def test_forceenter_handle_exception(default_conf, update, mocker) -> None:
def test_force_enter_handle_exception(default_conf, update, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
telegram, freqtradebot, msg_mock = get_telegram_testobject(mocker, default_conf)
patch_get_signal(freqtradebot)
update.message.text = '/forcebuy ETH/Nonepair'
telegram._forceenter(update=update, context=MagicMock(), order_side=SignalDirection.LONG)
telegram._force_enter(update=update, context=MagicMock(), order_side=SignalDirection.LONG)
assert msg_mock.call_count == 1
assert msg_mock.call_args_list[0][0][0] == 'Force_entry not enabled.'
def test_forceenter_no_pair(default_conf, update, mocker) -> None:
def test_force_enter_no_pair(default_conf, update, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
fbuy_mock = MagicMock(return_value=None)
@@ -1289,7 +1289,7 @@ def test_forceenter_no_pair(default_conf, update, mocker) -> None:
context = MagicMock()
context.args = []
telegram._forceenter(update=update, context=context, order_side=SignalDirection.LONG)
telegram._force_enter(update=update, context=context, order_side=SignalDirection.LONG)
assert fbuy_mock.call_count == 0
assert msg_mock.call_count == 1
@@ -1301,7 +1301,7 @@ def test_forceenter_no_pair(default_conf, update, mocker) -> None:
update = MagicMock()
update.callback_query = MagicMock()
update.callback_query.data = 'XRP/USDT_||_long'
telegram._forceenter_inline(update, None)
telegram._force_enter_inline(update, None)
assert fbuy_mock.call_count == 1