def execute():
     try:
         self._adapter.notify_user_message(user, session_id, message)
     except Exception as err:
         res = meta_protocol.write_notify_user_message(err)
     else:
         res = meta_protocol.write_notify_user_message()
     return res
 def execute():
     try:
         self._adapter.notify_user_message(user, session_id, message)
     except Exception as err:
         res = meta_protocol.write_notify_user_message(err)
     else:
         res = meta_protocol.write_notify_user_message()
     return res
Пример #3
0
 def test_num_generic_exception(self):
     """Tests the response to a NUM request in case of a generic exception.
     """
     error = RuntimeError("Generic Error")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|E|Generic+Error", res)
Пример #4
0
 def test_num_notification_error(self):
     """Tests the response to a NUM request in case of a NotificationError.
     """
     error = NotificationError("Notification Error")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|EN|Notification+Error", res)
Пример #5
0
 def test_num_credits_error(self):
     """Tests the response to a NUM request in case of a CreditsError."""
     error = CreditsError(10, "Credits Error", "User Msg")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|EC|Credits+Error|10|User+Msg", res)
Пример #6
0
 def test_num(self):
     """Tests the response to a NUM request."""
     res = metadata_protocol.write_notify_user_message()
     self.assertEqual("NUM|V", res)
 def test_num_generic_exception(self):
     """Tests the response to a NUM request in case of a generic exception.
     """
     error = RuntimeError("Generic Error")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|E|Generic+Error", res)
 def test_num_notification_error(self):
     """Tests the response to a NUM request in case of a NotificationError.
     """
     error = NotificationError("Notification Error")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|EN|Notification+Error", res)
 def test_num_credits_error(self):
     """Tests the response to a NUM request in case of a CreditsError."""
     error = CreditsError(10, "Credits Error", "User Msg")
     res = metadata_protocol.write_notify_user_message(error)
     self.assertEqual("NUM|EC|Credits+Error|10|User+Msg", res)
 def test_num(self):
     """Tests the response to a NUM request."""
     res = metadata_protocol.write_notify_user_message()
     self.assertEqual("NUM|V", res)