def execute():
     try:
         self._adapter.notify_new_session(user, session_id,
                                          client_context)
         res = meta_protocol.write_notify_new_session()
     except Exception as err:
         res = meta_protocol.write_notify_new_session(err)
     return res
 def execute():
     try:
         self._adapter.notify_new_session(user,
                                          session_id,
                                          client_context)
         res = meta_protocol.write_notify_new_session()
     except Exception as err:
         res = meta_protocol.write_notify_new_session(err)
     return res
Exemplo n.º 3
0
 def test_nns_notification_error(self):
     """Tests the response to a NNS request in case of a
     NotificationError.
     """
     error = NotificationError("error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|EN|error", res)
 def test_nns_notification_error(self):
     """Tests the response to a NNS request in case of a
     NotificationError.
     """
     error = NotificationError("error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|EN|error", res)
Exemplo n.º 5
0
 def test_nns_conflict_session_error(self):
     """Tests the response to a NNS request in case of a
     ConflictingSessionError.
     """
     error = ConflictingSessionError(12, "Conflicting Session Error",
                                     "S1123", "User Message Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual(("NNS|EX|Conflicting+Session+Error|12|"
                       "User+Message+Error|S1123"), res)
 def test_nns_conflict_session_error(self):
     """Tests the response to a NNS request in case of a
     ConflictingSessionError.
     """
     error = ConflictingSessionError(12, "Conflicting Session Error",
                                     "S1123", "User Message Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual(("NNS|EX|Conflicting+Session+Error|12|"
                       "User+Message+Error|S1123"), res)
Exemplo n.º 7
0
 def test_nns_generic_exception(self):
     """Tests the response to a NNS request in case of a generic exception.
     """
     error = RuntimeError("Generic Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|E|Generic+Error", res)
Exemplo n.º 8
0
 def test_nns_credits_error(self):
     """Tests the response to a NNS request in case of a CreditsError."""
     error = CreditsError(12, "Credits Error", "Message Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|EC|Credits+Error|12|Message+Error", res)
Exemplo n.º 9
0
 def test_nns(self):
     """Tests the response to a NNS request. """
     res = metadata_protocol.write_notify_new_session()
     self.assertEqual("NNS|V", res)
 def test_nns_generic_exception(self):
     """Tests the response to a NNS request in case of a generic exception.
     """
     error = RuntimeError("Generic Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|E|Generic+Error", res)
 def test_nns_credits_error(self):
     """Tests the response to a NNS request in case of a CreditsError."""
     error = CreditsError(12, "Credits Error", "Message Error")
     res = metadata_protocol.write_notify_new_session(error)
     self.assertEqual("NNS|EC|Credits+Error|12|Message+Error", res)
 def test_nns(self):
     """Tests the response to a NNS request. """
     res = metadata_protocol.write_notify_new_session()
     self.assertEqual("NNS|V", res)