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)
def __publish(self, msg): try: logger.debug(msg) self.__publish_raw(msg) except: logger.error(traceback.format_exc()) raise hap.Signal(critical=True)
def test_critical_is_true(self): obj = hap.Signal(critical=True) self.assertEquals(True, obj.critical)
def test_restart_is_true(self): obj = hap.Signal(restart=True) self.assertEquals(True, obj.restart)
def test_default(self): obj = hap.Signal() self.assertEquals(False, obj.restart) self.assertEquals(False, obj.critical)
def test_handle_exception_critical_signal(self): try: raise hap.Signal(critical=True) except: self.assertRaises(hap.Signal, hap.handle_exception)