Skip to content

Add unit tests for Discussion, BaseMessage, and HTML tag parsing utilities - #8

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1773093839-add-discussion-unit-tests
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1773093839-add-discussion-unit-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

Summary

Adds 35 unit tests in a new file tests/llm/test_discussion.py covering previously untested utilities in llm_utils.py:

  • Discussion class: construction (empty, single message, list), add_message/append (from BaseMessage, dict, role+content kwargs), properties (last_message, __len__, __getitem__, __iter__, __str__), conversions (to_string, to_openai, to_markdown), and content helpers (add_text, add_content).
  • BaseMessage / SystemMessage / HumanMessage / AIMessage: role assignment, invalid kwarg rejection, __str__ with string and list content, to_markdown.
  • extract_html_tags: single key, multiple matches, missing key, multiline content.
  • parse_html_tags: required vs optional keys, duplicate key handling with and without merge_multiple.
  • parse_html_tags_raise: raises ParseError on missing keys, returns dict on success.

No production code changes.

Review & Testing Checklist for Human

  • Verify tests are meaningful: spot-check a few tests to confirm they exercise real class behavior rather than tautological assertions (e.g., TestDiscussionConversions.test_to_string_merges should confirm adjacent text elements actually get merged)
  • Run the test suite locally: uv run pytest tests/llm/test_discussion.py -v — all 35 tests should pass

Notes


Open with Devin

…ities

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

1 participant