Raise premature exceptions that happen before switch role
Currently, the following bad scenarios are possible:
1) Forbidden expected, Forbidden thrown prematurely
@rbac_
def test_list_
# During test set up, a Forbidden exception is raised
What should happen: The Forbidden is raised by the test and results in test failure.
What actually happens: The Forbidden exception is treated as a test success.
2) NotFound expected, NotFound thrown prematurely
@rbac_
def test_list_
# During test set up, a NotFound exception is raised
What should happen: The NotFound is raised by the test and results in test failure.
What actually happens: The NotFound exception is treated as a test success.
Validation should be added to prevent either case from happening. Patrole should only validate that the exception raised following switch_role is the expected one -- any exceptions (except for skipException) raised before switch_role should result in an error and test failure because that is a result of bad setup.
Blueprint information
- Status:
- Complete
- Approver:
- Felipe Monteiro
- Priority:
- Medium
- Drafter:
- Felipe Monteiro
- Direction:
- Approved
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Felipe Monteiro
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Raise premature exceptions that happen before switch role
This is not a valid issue because if a premature exception is raised, then switch_role will not be called the correct number of times -- for which validation already exists -- causing the test to fail.