Add typing and tests for JSONOutput, and fix some bad results.

Review Request #13034 — Created May 10, 2023 and submitted — Latest diff uploaded

Information

RBTools
release-5.x

Reviewers

This updates JSONOutput to have type hints, helping callers use the
right arguments, and fixes some bad documentation.

It also fixes up a less-than-ideal exception for .append(), which was
raising a (documented) AttributeError if trying to append to a
non-list.

We now have unit tests covering all of the class, ensuring we don't
regress.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add typing and tests for JSONOutput, and fix some bad results.
This updates `JSONOutput` to have type hints, helping callers use the right arguments, and fixes some bad documentation. It also fixes up a less-than-ideal exception for `.append()`, which was raising a (documented) `AttributeError` if trying to append to a non-list. We now have unit tests covering all of the class, ensuring we don't regress.
13a64da3f7ccaeebec568e5b3730a3a9ad233e97 Christian Hammond
rbtools/commands/base/output.py
rbtools/commands/tests/test_base_output.py
Loading...