Update the Bazaar unit tests to use build_client() and clean up asserts.

Review Request #12502 — Created Aug. 5, 2022 and submitted

Information

RBTools
release-4.x

Reviewers

This updates the Bazaar unit tests to build a BazaarClient in each
test where it's needed, rather than in setUp(). This is in prepration
for new tests that will need to handle client construction differently.

The test suite temporarily implements a wrapping build_client()
function that sets the appropriate bzr/brz binary as the default for
the client. When the new dependency code is ready, this function will be
removed.

This also cleans up a lot of the assertions to be less verbose, and
more specific. We had a lot of combinations of checking instance type,
key presence, and then values, but this is far less useful (less
accurate) than just checking dictionaries for equality. Given the work
being done already in each function, I felt this was the best time to
clean this code up.

All unit tests pass.

Summary ID
Update the Bazaar unit tests to use build_client() and clean up asserts.
This updates the Bazaar unit tests to build a `BazaarClient` in each test where it's needed, rather than in `setUp()`. This is in prepration for new tests that will need to handle client construction differently. The test suite temporarily implements a wrapping `build_client()` function that sets the appropriate `bzr`/`brz` binary as the default for the client. When the new dependency code is ready, this function will be removed. This also cleans up a lot of the assertions to be less verbose. We had a lot of combinations of checking instance type, key presence, and then values, but this is far less useful (less accurate) than just checking dictionaries for equality. Given the work being done already in each function, I felt this was the best time to clean this code up.
a88d1dbac6dd6cccb3962ab2134aa2854ca06813
david
  1. Ship It!
  2. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (42ec5ec)
Loading...