Ejemplo n.º 1
0
 def test_action_not_good(monkeypatch):
     monkeypatch.setattr(StatefullAction, "_check_fct",
                         MagicMock(side_effect=ActionException))
     action = StatefullAction()
     with pytest.raises(ActionException):
         action.action(lambda state: 10)
Ejemplo n.º 2
0
 def test_action_twice(monkeypatch):
     monkeypatch.setattr(StatefullAction, "_check_fct", MagicMock())
     action = StatefullAction()
     action.action(lambda state: 10)
     with pytest.raises(ActionException):
         action.action(lambda state: 10)
Ejemplo n.º 3
0
 def test_action(monkeypatch):
     monkeypatch.setattr(StatefullAction, "_check_fct", MagicMock())
     action = StatefullAction()
     assert action.action(lambda state: 10)