Esempio 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
Esempio 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