Consolidate basic API unit test setup and prepare for expansion options.

Review Request #13376 — Created Oct. 25, 2023 and submitted

Information

Review Board
release-5.0.x

Reviewers

Our API unit test setup has grown over time in ways that made it hard to
build upon.

We had dedicated methods for the Local Site setup that took care of
fixture loading, authentication, subclass setup state, and some
assertions, but we didn't have this for non-Local Site tests, each of
which had to implement this setup manually, leading to inconsistencies.

The setup functions we did have used tuple results, which made them hard
to build upon. This is also an issue for the subclass's return values
(though changing that is out of scope for this work and isn't necessary
for upcoming changes).

This change moves the setup functions out of the Local Site mixins and
into the base test class mixins, giving them options for controlling
some more aspects of test setup to meet all the current needs. They also
now return dictionaries of information.

These changes make it easier to expand upon this for some upcoming work.

Unit tests pass.

Summary ID
Consolidate basic API unit test setup and prepare for expansion options.
Our API unit test setup has grown over time in ways that made it hard to build upon. We had dedicated methods for the Local Site setup that took care of fixture loading, authentication, subclass setup state, and some assertions, but we didn't have this for non-Local Site tests, each of which had to implement this setup manually, leading to inconsistencies. The setup functions we did have used tuple results, which made them hard to build upon. This is also an issue for the subclass's return values (though changing that is out of scope for this work and isn't necessary for upcoming changes). This change moves the setup functions out of the Local Site mixins and into the base test class mixins, giving them options for controlling some more aspects of test setup to meet all the current needs. They also now return dictionaries of information. These changes make it easier to expand upon this for some upcoming work.
d55578c6e4b7508e203768c54ad8a344dbd1d54b
Description From Last Updated

local variable 'user' is assigned to but never used Column: 9 Error code: F841

reviewbotreviewbot

local variable 'user' is assigned to but never used Column: 9 Error code: F841

reviewbotreviewbot

local variable 'user' is assigned to but never used Column: 9 Error code: F841

reviewbotreviewbot

local variable 'user' is assigned to but never used Column: 9 Error code: F841

reviewbotreviewbot

local variable 'user' is assigned to but never used Column: 9 Error code: F841

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
chipx86
chipx86
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.0.x (87bef7c)
Loading...