def test_shouldSendMessageIfYouKickedYourself(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.kicks_himself,
         Notifier.KickActionData(self._whom_user, self._branch,
                                 self._whom_user))
     message = str.format(
         "You've kicked yourself from branch <b>{}</b>. Tell me, are you alright? Next "
         "time use /cancel command, it much more effective.", self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
 def test_shouldSendMessageIfSomeoneKickedHimself(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.kicks_himself,
         Notifier.KickActionData(self._action_user, self._branch,
                                 self._action_user))
     message = str.format(
         "<i>{0}</i> has kicked himself from branch <b>{1}</b>. What a strange way for suicide.",
         self._action_user.get_name(), self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
 def test_shouldSendMessageIfSomeoneKickedYou(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.kicks_user,
         Notifier.KickActionData(self._action_user, self._branch,
                                 self._whom_user))
     message = str.format(
         "<i>{0}</i> has kicked you from branch <b>{1}</b>. Nothing personal, only business.",
         self._action_user.get_name(), self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
 def test_shouldSendMessageIfSomeoneKickedUser(self):
     self._presentation_model.notify(
         self._whom_user, NotifierActions.kicks_user,
         Notifier.KickActionData(self._action_user, self._branch,
                                 self._kicked_user))
     message = str.format(
         "<i>{0}</i> has kicked {1} from branch <b>{2}</b>. Even I shocked by this cruelty.",
         self._action_user.get_name(), self._kicked_user.get_name(),
         self._branch)
     self._message_sender.send.assert_called_once_with(
         self._whom_user_id, message)
Ejemplo n.º 5
0
    def test_shouldNotifyUsersWhenUserKicksHimself(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._merge_dispatcher.kick(self._first_user_id, self._first_user_id,
                                    branch)
        action_data = Notifier.KickActionData(
            self._model.get_user(self._first_user_id), branch,
            self._model.get_user(self._first_user_id))

        self._notifier.notify.assert_any_call(
            self._model.get_user(self._first_user_id),
            NotifierActions.kicks_himself, action_data)
        self._notifier.notify.assert_any_call(
            self._model.get_user(self._second_user_id),
            NotifierActions.kicks_himself, action_data)