Exemplo n.º 1
0
 def test_undo_notify_exception(monkeypatch):
     notif_mock = MagicMock()
     monkeypatch.setattr(Action, "notify", notif_mock)
     action = Action(None, MagicMock(side_effect=Exception))
     try:
         action.undo()
     except Exception:
         pass
     assert notif_mock.call_count == 2
Exemplo n.º 2
0
 def test_undo_notify(monkeypatch):
     notif_mock = MagicMock()
     monkeypatch.setattr(Action, "notify", notif_mock)
     action = Action(None, MagicMock())
     action.undo()
     assert notif_mock.call_count == 2