Webwright icon indicating copy to clipboard operation
Webwright copied to clipboard

test: add unit tests for parse_json_output

Open nuthalapativarun opened this issue 6 months ago • 0 comments

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

nuthalapativarun avatar May 29 '26 06:05 nuthalapativarun