Allow webhook message setting directly

This commit is contained in:
Matthias
2022-10-07 20:44:47 +02:00
parent 8fcb80df69
commit fb2f2d9a39
4 changed files with 13 additions and 6 deletions

View File

@@ -99,6 +99,7 @@ def test_send_msg_telegram_error(mocker, default_conf, caplog) -> None:
def test_process_msg_queue(mocker, default_conf, caplog) -> None:
telegram_mock = mocker.patch('freqtrade.rpc.telegram.Telegram.send_msg')
default_conf['telegram']['allow_custom_messages'] = True
mocker.patch('freqtrade.rpc.telegram.Telegram._init')
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -108,8 +109,8 @@ def test_process_msg_queue(mocker, default_conf, caplog) -> None:
queue.append('Test message 2')
rpc_manager.process_msg_queue(queue)
assert log_has("Sending rpc message: {'type': strategy_msg, 'msg': 'Test message'}", caplog)
assert log_has("Sending rpc message: {'type': strategy_msg, 'msg': 'Test message 2'}", caplog)
assert log_has("Sending rpc strategy_msg: Test message", caplog)
assert log_has("Sending rpc strategy_msg: Test message 2", caplog)
assert telegram_mock.call_count == 2