コード例 #1
0
 def test_get_alert_from_other_message(self):
     # type: () -> None
     message = self.get_message(0)
     message.trigger = 'stream_push_notify'
     alert = apn.get_alert_from_message(message)
     alert = apn.get_alert_from_message(self.get_message(0))
     self.assertEqual(alert,
                      "New Zulip mentions and private messages from King "
                      "Hamlet")
コード例 #2
0
 def test_get_alert_from_stream_message(self):
     # type: () -> None
     message = self.get_message(Recipient.STREAM)
     message.trigger = 'stream_push_notify'
     message.stream_name = 'Denmark'
     alert = apn.get_alert_from_message(message)
     self.assertEqual(alert, "New stream message from King Hamlet in Denmark")
コード例 #3
0
 def test_get_alert_from_mention(self):
     # type: () -> None
     message = self.get_message(Recipient.STREAM)
     message.triggers = {
         'private_message': False,
         'mentioned': True,
         'stream_push_notify': False,
     }
     alert = apn.get_alert_from_message(message)
     self.assertEqual(alert, "New mention from King Hamlet")
コード例 #4
0
 def test_get_alert_from_mention(self):
     # type: () -> None
     message = self.get_message(Recipient.STREAM)
     message.trigger = 'mentioned'
     alert = apn.get_alert_from_message(message)
     self.assertEqual(alert, "New mention from King Hamlet")
コード例 #5
0
 def test_get_alert_from_private_message(self):
     # type: () -> None
     message = self.get_message(Recipient.PERSONAL)
     message.trigger = 'private_message'
     alert = apn.get_alert_from_message(message)
     self.assertEqual(alert, "New private message from King Hamlet")