def test_shouldSendMessageIfSomeoneStartedMergeFixInYourQueue(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.starts_fix,
         Notifier.MergeFixActionData(self._action_user, self._branch, None))
     message = str.format(Messages.ACTION_MESSAGE_STARTS_FIX,
                          self._action_user.get_name(), self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
 def test_shouldSendMessageIfYouWasPushedAwayByMergeFix(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.starts_fix,
         Notifier.MergeFixActionData(self._action_user, self._branch,
                                     self._whom_user))
     message = str.format(Messages.ACTION_MESSAGE_PUSH_BACK,
                          self._action_user.get_name(), self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
Пример #3
0
 def test_shouldNotifyActiveUserWhenHeIsPutBackToQueue(self):
     branch = self._config.get_branches()[0]
     self._merge_dispatcher.merge(self._first_user_id, branch)
     self._notifier.reset_mock()
     self._merge_dispatcher.fix(self._second_user_id, branch)
     self._notifier.notify.assert_any_call(
         self._model.get_user(self._first_user_id),
         NotifierActions.starts_fix,
         Notifier.MergeFixActionData(
             self._model.get_user(self._second_user_id), branch,
             self._model.get_user(self._first_user_id)))
Пример #4
0
 def test_shouldNotifyUsersWhenSomeoneStartsFix(self):
     branch = self._config.get_branches()[0]
     self._merge_dispatcher.merge(self._first_user_id, branch)
     self._merge_dispatcher.merge(self._second_user_id, branch)
     self._notifier.reset_mock()
     self._merge_dispatcher.fix(self._third_user_id, branch)
     self._notifier.notify.assert_any_call(
         self._model.get_user(self._first_user_id),
         NotifierActions.starts_fix,
         Notifier.MergeFixActionData(
             self._model.get_user(self._third_user_id), branch,
             self._model.get_user(self._first_user_id)))