Skip to content

Clear State before raising errors - #34

Merged
lcarcaramo merged 5 commits into
devfrom
cleanup_after_segment_errors
Nov 3, 2023
Merged

Clear State before raising errors#34
lcarcaramo merged 5 commits into
devfrom
cleanup_after_segment_errors

Conversation

@ElijahSwiftIBM

Copy link
Copy Markdown
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
Comment thread tests/user/test_user_request_builder.py
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>
Comment thread tests/user/test_user_request_builder.py Outdated
@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