Skip to content

Add regression coverage for InputRichMessage rich-text serialization shapes - #2612

Closed
Badiboy with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-review-comment-2610
Closed

Add regression coverage for InputRichMessage rich-text serialization shapes#2612
Badiboy with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-review-comment-2610

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown

This addresses the review comment on rich message serialization coverage. It adds focused regression tests for the three supported RichText input shapes when serialized through InputRichMessage / InputRichBlock, including a subtype with required extra fields.

  • Coverage added

    • plain string block text
    • nested list-based rich text
    • nested RichText objects
  • Subtype regression guard

    • adds explicit coverage for RichTextDateTime nested inside another rich-text node
    • asserts unix_time and date_time_format survive serialization so incomplete subtype payloads are caught
  • Scope

    • test-only change in tests/test_types.py
    • no production behavior changes
message = types.InputRichMessage(
    blocks=[
        types.InputRichBlockParagraph(
            text=types.RichTextBold(
                types.RichTextDateTime(
                    text='Mar 1',
                    unix_time=1740787200,
                    date_time_format='short',
                )
            )
        )
    ]
)

assert message.to_dict()['blocks'][0]['text'] == {
    'type': 'bold',
    'text': {
        'type': 'date_time',
        'text': 'Mar 1',
        'unix_time': 1740787200,
        'date_time_format': 'short',
    },
}

Co-authored-by: Badiboy <5613421+Badiboy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code per review comment in PR #2610 Add regression coverage for InputRichMessage rich-text serialization shapes Aug 12, 2026
Copilot AI requested a review from Badiboy August 12, 2026 14:29
@Badiboy

Badiboy commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

@coder2020official Do we need this? :)

@Badiboy
Badiboy marked this pull request as ready for review August 12, 2026 14:30
@coder2020official

Copy link
Copy Markdown
Collaborator

I feel like it's useless, our tests coverage is non-existent anyways and this PR doesn't do much

@Badiboy Badiboy closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants