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

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

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.

Summary ID
Add a unit test assertion method for bulk-checking object attributes.
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.
d56f885dfef5821cb5de92e4be7a06738c453d28
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.0.x (eb889f1)