def close(self):
        if self.__connection is not None:
            try:
                self.__connection.close()
            except:
                # On some condition such as Ubuntu 14.04, the above close()
                # raises an exception when the rabbitmq-server is stopped.
                hap.handle_exception()

            self.__connection = None
Exemple #2
0
    def close(self):
        if self.__connection is not None:
            try:
                self.__connection.close()
            except:
                # On some condition such as Ubuntu 14.04, the above close()
                # raises an exception when the rabbitmq-server is stopped.
                hap.handle_exception()

            self.__connection = None
Exemple #3
0
 def test_handle_exception(self):
     obj = Gadget()
     try:
         raise obj
     except:
         exctype, value = hap.handle_exception()
     self.assertEquals(Gadget, exctype)
     self.assertEquals(obj, value)
Exemple #4
0
 def test_handle_exception(self):
     obj = Gadget()
     try:
         raise obj
     except:
         exctype, value = hap.handle_exception()
     self.assertEquals(Gadget, exctype)
     self.assertEquals(obj, value)