Add a unit test assertion method for bulk-checking object attributes.

Review Request #11318 — Created Dec. 7, 2020 and submitted — Latest diff uploaded

Information

Djblets
release-1.0.x

Reviewers

This introduces assertAttrsEqual(), an assertion method that takes an
object and a dictionary of attribute names and values and compares for
equality. If an attribute is missing or not of the expected value,
this will raise an exception.

The new method is useful for comparing the populated fields of an object
after creation or modification, improving readability and reducing
the maintenance burden.

Used this in some unit tests I'm building. Tested both error conditions
and the success condition.

Commits

Files