Skip to content

test: cover parse_html_tags required/optional/repeated/merge branches - #27

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677963-parse-html-tags-tests
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677963-parse-html-tags-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Closes a test-coverage gap flagged by a code scan: parse_html_tags / parse_html_tags_raise is the parser every agent uses to turn raw LLM text into answer dicts, but its branch matrix was only partially exercised (tests/llm/test_llm_utils.py covered basic single-tag and code-block extraction only).

Adds five pure-string tests (no mocks) in tests/llm/test_llm_utils.py pinning each branch:

  • required + optional keys all present -> valid=True, empty retry message
  • missing required key -> valid=False, retry message names <action>; parse_html_tags_raise raises ParseError
  • missing optional key -> no error, key simply absent from the dict
  • repeated key, merge_multiple=False -> valid=False ("multiple instances"), dict keeps the first value; raise variant raises
  • repeated key, merge_multiple=True -> values joined with \n (the path ActionPrompt._parse_answer relies on for multi-action answers)

No production code changed. pytest tests/llm/test_llm_utils.py passes (16 tests).

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/ca11b20a11c041be9e2917ea2629777a
Open in Devin Desktop: https://app.devin.ai/desktop/session/ca11b20a11c041be9e2917ea2629777a?variant=devin

@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, CI, and merge conflict monitoring

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.

0 participants