55from telegram import Update , User , Chat , Message as TelegramMessage
66from telegram .ext import ContextTypes
77
8- from app .telegram import TelegramBot , convert_markdown_to_html
8+ from app .telegram import TelegramBot
99from app .models import Message
1010from app .message_processor import MessageProcessor
1111
@@ -164,8 +164,8 @@ async def test_handle_message_success(self, telegram_bot):
164164 assert call_args [0 ][0 ] == 123 # chat_id
165165 assert isinstance (call_args [0 ][1 ], Message )
166166
167- # Verify response was sent with user mention (since it's a group chat)
168- update .message .reply_text .assert_called_once_with ("@testuser Hi there!" , parse_mode = 'HTML ' )
167+ # Verify response was sent with user mention (since it's a group chat)
168+ update .message .reply_text .assert_called_once_with ("@testuser Hi there!" , parse_mode = 'Markdown ' )
169169
170170 # Verify typing action was sent
171171 context .bot .send_chat_action .assert_called_once_with (chat_id = 123 , action = "typing" )
@@ -204,7 +204,7 @@ async def test_handle_message_private_chat(self, telegram_bot):
204204 await telegram_bot ._handle_message (update , context )
205205
206206 # Verify response was sent without user mention (since it's a private chat)
207- update .message .reply_text .assert_called_once_with ("Hi there!" , parse_mode = 'HTML ' )
207+ update .message .reply_text .assert_called_once_with ("Hi there!" , parse_mode = 'Markdown ' )
208208
209209 @pytest .mark .asyncio
210210 async def test_handle_message_no_text (self , telegram_bot ):
@@ -496,24 +496,5 @@ async def test_handle_message_logging(self, telegram_bot):
496496 # Should log receiving message and adding to processor
497497 assert mock_logger .debug .call_count >= 2
498498
499- def test_convert_markdown_to_html (self ):
500- """Test markdown to HTML conversion function"""
501- # Test bold text
502- assert convert_markdown_to_html ("**bold**" ) == "<b>bold</b>"
503-
504- # Test italic text
505- assert convert_markdown_to_html ("*italic*" ) == "<i>italic</i>"
506-
507- # Test code
508- assert convert_markdown_to_html ("`code`" ) == "<code>code</code>"
509-
510- # Test combined formatting
511- result = convert_markdown_to_html ("**IO Net Assistant** provides *specific* info about `io.net`" )
512- expected = "<b>IO Net Assistant</b> provides <i>specific</i> info about <code>io.net</code>"
513- assert result == expected
514-
515- # Test HTML escaping
516- result = convert_markdown_to_html ("Test & escape < > characters" )
517- assert "&" in result
518- assert "<" in result
519- assert ">" in result
499+
500+
0 commit comments