-
Notifications
You must be signed in to change notification settings - Fork 3
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
Don't skip failed actions on preparation stage #27
Conversation
simple_action._prepare_action.assert_called_once() | ||
saved_action._prepare_action.assert_called_once() | ||
|
||
def test_skip_failed_saved_state(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 tests are almost identical. Could they be converted into invocations of a single function with different parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it will simplify things, but ok let's do it
saved_action = SavedAction() | ||
|
||
if phase == "prepare": | ||
simple_action._prepare_action = mock.Mock(return_value=action.ActionResult()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to use setattr()
and getattr()
to avoid duplicating these assignments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase before merge.
We need to make all required actions on the preparation stage, so if some action has been failed, we should re-perform it
oved the logic for tests into a separate function since it was nearly identical
7035418
to
f1ed9cc
Compare
We need to make all required actions on the preparation stage, so if some action has been failed, we should re-perform it