From 61515e81163509cb05263dc59d5e63a9ed1c613e Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 9 Aug 2026 12:50:22 +0530 Subject: [PATCH] fix: update legacy draft test for new supports_draft_streaming gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing test asserted supports_draft_streaming returns True with rich_messages=True and rich_drafts=False, but the PR's gate now makes it return False. The test already force-sets _use_draft_streaming=True, so the assertion was redundant — updated to reflect the new behavior. Also removed redundant manual attribute overrides in test 3 where _make_adapter(extra={'rich_messages': False}) already sets the flag. --- tests/gateway/test_telegram_rich_messages.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/gateway/test_telegram_rich_messages.py b/tests/gateway/test_telegram_rich_messages.py index 566ee13ea4cae..f3dfb90a2a1f5 100644 --- a/tests/gateway/test_telegram_rich_messages.py +++ b/tests/gateway/test_telegram_rich_messages.py @@ -389,7 +389,10 @@ def test_prefers_fresh_final_streaming_stays_disabled_when_rich_enabled(): async def test_legacy_draft_stream_finalizes_with_persistent_rich_message(): """A MarkdownV2 draft must not force the persistent final to MarkdownV2.""" adapter = _make_adapter() # rich messages on, rich drafts off - assert adapter.supports_draft_streaming(chat_type="dm") is True + # With the gate in supports_draft_streaming, draft streaming is declined + # when rich_drafts is off. The test force-enables it to verify that even + # a legacy MDV2 draft still finalizes as a rich message. + assert adapter.supports_draft_streaming(chat_type="dm") is False consumer = GatewayStreamConsumer( adapter, @@ -429,9 +432,6 @@ def test_supports_draft_streaming_enabled_when_rich_drafts_opt_in(): def test_supports_draft_streaming_legacy_when_rich_messages_off(): adapter = _make_adapter(extra={"rich_messages": False}) - # _make_adapter always injects rich_messages True via default; force off. - adapter._rich_messages_enabled = False - adapter._rich_drafts_enabled = False assert adapter.supports_draft_streaming(chat_type="dm") is True