Skip to content

test: add unit tests for parse_json_output#32

Open
nuthalapativarun wants to merge 1 commit into
microsoft:mainfrom
nuthalapativarun:feat/test-parse-json-output
Open

test: add unit tests for parse_json_output#32
nuthalapativarun wants to merge 1 commit into
microsoft:mainfrom
nuthalapativarun:feat/test-parse-json-output

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Problem

parse_json_output in base.py is called on every agent step but has no test coverage. The done-demotion logic (demoting done=true to false when there is a non-empty action) is a subtle invariant that is easy to break silently.

Fix

Add tests/unit/test_parse_json_output.py with tests covering: valid JSON roundtrip, done demotion when action is non-empty, done preserved when action is empty, non-dict JSON raises ValueError, malformed JSON raises ValueError, and custom action_field.

Changes

  • tests/unit/test_parse_json_output.py — new test file, 6 test cases

Not affected

  • parse_json_output implementation — not changed
  • All other source files — not touched

parse_json_output is called on every agent step but had no tests.
Cover the done-demotion logic, non-dict JSON, malformed JSON, and
the custom action_field parameter.
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