ambitus / pyracf

Python interface to the RACF Command interface.
https://ambitus.github.io/pyracf/
Apache License 2.0
10 stars 4 forks source link

Clear State before raising errors #34

Closed ElijahSwiftIBM closed 8 months ago

ElijahSwiftIBM commented 8 months ago

Add state clearing before raising SegmentError or SegmentTraitError.

Add unit test for this (Unit test for SegmentTraitError includes extract to simulate functionality of add when generateRequestOnly is not set)

:bulb: Issue Reference

Issue: #33

:computer: What does this address?

SegmentError and SegmentTraitError exit the code without clearing segment trait dictionaries. This leads to improper request dictionaries built on the next request.

:pager: Implementation Details

added call to clear_state() function before throwing errors.

:clipboard: Is there a test case?

Built new test cases, one for SegmentError and one for SegmentTraitError, both hanging off of USER Admin

Test cases work as designed. Without clear_state() both fail, with it they succeed.