testing: tests should account for different responses on same endpoint
Closed this issue · 1 comments
The sdpctl testing suite should be able to give different responses on multiple requests to the same endpoint.
Currently, the API mocking does not allow for registering multiple responses for the same endpoint, which makes it difficult to test for changing appliance states.
For example, before an upgrade, an appliance has a volume number. Upon a successful upgrade, this volume number will change, indicating that the appliance has switched partition to the new version. In short, if the volume number hasn't changed after upgrade complete
has finished on the appliance, that would indicate a failed or cancelled upgrade.
The volume number is fetched from the appliance stats API and checking the volume number means that the stats API endpoint need to called at least twice for each appliance that is upgraded. This means testing this scenario is impossible due to the test suite not allowing multiple responses to register for the same endpoint.