Example #1
0
 def __publish(self, msg):
     try:
         self.__publish_raw(msg)
     except:
         # TODO: consider the way to save the message and try to
         # send it again.
         raise hap.Signal(critical=True)
Example #2
0
 def __publish(self, msg):
     try:
         logger.debug(msg)
         self.__publish_raw(msg)
     except:
         logger.error(traceback.format_exc())
         raise hap.Signal(critical=True)
Example #3
0
 def test_critical_is_true(self):
     obj = hap.Signal(critical=True)
     self.assertEquals(True, obj.critical)
Example #4
0
 def test_restart_is_true(self):
     obj = hap.Signal(restart=True)
     self.assertEquals(True, obj.restart)
Example #5
0
 def test_default(self):
     obj = hap.Signal()
     self.assertEquals(False, obj.restart)
     self.assertEquals(False, obj.critical)
Example #6
0
 def test_handle_exception_critical_signal(self):
     try:
         raise hap.Signal(critical=True)
     except:
         self.assertRaises(hap.Signal, hap.handle_exception)