diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index e2540e885..97983ecd8 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -177,7 +177,7 @@ def test_telegram_init(default_conf, mocker, caplog) -> None: assert log_has(message_str, caplog) -async def test_telegram_startup(default_conf, mocker) -> None: +async def test_telegram_startup(default_conf, mocker, caplog) -> None: app_mock = MagicMock() app_mock.initialize = AsyncMock() app_mock.start = AsyncMock() @@ -193,6 +193,12 @@ async def test_telegram_startup(default_conf, mocker) -> None: assert app_mock.updater.start_polling.call_count == 1 assert sleep_mock.call_count == 1 + # Test telegram Retries and Exceptions + app_mock.start = AsyncMock(side_effect=Exception("Test exception")) + await telegram._startup_telegram() + assert app_mock.start.call_count == 3 + assert log_has("Telegram init failed.", caplog) + async def test_telegram_cleanup( default_conf,