示例#1
0
 def test_rollback_action_with_fct(monkeypatch):
     monkeypatch.setattr(StatefullAction, "_check_fct", MagicMock())
     action = StatefullAction()
     action.rollback_action(fct=lambda state: 10)
     assert action._rollback_fct({}) == 10
示例#2
0
 def test_rollback_action(monkeypatch):
     monkeypatch.setattr(StatefullAction, "_check_fct", MagicMock())
     action = StatefullAction()
     decorator = action.rollback_action()
     decorator(lambda state: 10)
     assert action._rollback_fct({}) == 10