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

Review Request #12509 — Created Aug. 5, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-4.x

Reviewers

This updates the Perforce unit tests to build a PerforceClient 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.

This also cleans up a lot of the assertions to be less verbose and to be
more comprehensive.

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. We missed things because we weren't
doing these checks.

It also fixes up diff checking to compare for content and not just a
hash. This will be important for work on supporting alternative diff
tools.

All Perforce unit tests pass.

Changes between revision 1 and 2

orig
1
2

Commits

Summary ID Author
Update the Perforce unit tests to use build_client() and clean up tests.
This updates the Perforce unit tests to build a `PerforceClient` 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. This also cleans up a lot of the assertions to be less verbose and to be more comprehensive. 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. We missed things because we weren't doing these checks. It also fixes up diff checking to compare for content and not just a hash. This will be important for work on supporting alternative diff tools.
823176be52efb17ab153e850d7172ae7567ecd15 Christian Hammond
Update the Perforce unit tests to use build_client() and clean up tests.
This updates the Perforce unit tests to build a `PerforceClient` 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. This also cleans up a lot of the assertions to be less verbose and to be more comprehensive. 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. We missed things because we weren't doing these checks. It also fixes up diff checking to compare for content and not just a hash. This will be important for work on supporting alternative diff tools.
2117b0e8565585fe079b38662a836e32f87aafcd Christian Hammond
rbtools/clients/tests/test_p4.py
Loading...