Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear State before raising errors #34

Merged
merged 5 commits into from
Nov 3, 2023
Merged

Conversation

ElijahSwiftIBM
Copy link
Collaborator

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)

💡 Issue Reference

Issue: #33

💻 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.

📟 Implementation Details

added call to clear_state() function before throwing errors.

📋 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.

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)

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
@lcarcaramo lcarcaramo self-requested a review November 3, 2023 11:31
@lcarcaramo lcarcaramo added the bug Something isn't working label Nov 3, 2023
@lcarcaramo lcarcaramo added this to the Beta 1.0b1 milestone Nov 3, 2023
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
added comment to describe need for extract call in new test.

Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the cleanup_after_segment_errors branch from 0e6c510 to 4504025 Compare November 3, 2023 14:28
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
@ElijahSwiftIBM ElijahSwiftIBM force-pushed the cleanup_after_segment_errors branch from 4504025 to eca4e7c Compare November 3, 2023 14:32
@lcarcaramo lcarcaramo merged commit 070947c into dev Nov 3, 2023
@lcarcaramo lcarcaramo deleted the cleanup_after_segment_errors branch November 3, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants