import unittest
import html
import re
from telegram_handlers import _format_telegram_message
class TestTelegramFormatting(unittest.TestCase):
def test_bold_conversion(self):
"""Test that **text** is converted to text."""
input_text = "This is **bold** text."
expected = "This is bold text."
result = _format_telegram_message(input_text)
self.assertEqual(result, expected)
def test_multiple_bold(self):
"""Test multiple bold sections."""
input_text = "**First** and **second** bold."
expected = "First and second bold."
result = _format_telegram_message(input_text)
self.assertEqual(result, expected)
def test_html_escaping(self):
"""Test that HTML characters are escaped."""
input_text = "Text with