diff --git a/tests/test_telegram_helper.py b/tests/test_telegram_helper.py index 88f10ef..18e819b 100644 --- a/tests/test_telegram_helper.py +++ b/tests/test_telegram_helper.py @@ -146,8 +146,10 @@ class TestTelegramHelper(unittest.IsolatedAsyncioTestCase): with patch('asyncio.sleep', new_callable=AsyncMock) as mock_sleep: await self.telegram_helper.handle_message(self.mock_update, self.mock_context) - # Initial call + two chunks + # Initial call to reply_text + two chunks sent via reply_text self.assertEqual(self.mock_update.message.reply_text.call_count, 1 + 2) + # asyncio.sleep is called once for each chunk *after* the first one. + # For 2 chunks, it's called once. self.assertEqual(mock_sleep.call_count, 1) # One sleep for the second chunk @patch.object(TelegramHelper, '_handle_message_logic', new_callable=AsyncMock)