def tearDown(self): if not DEBUG: self.worker_processes.terminate() if self.queue: delete_queue("localhost", self.queue) if self.testrun_id: delete_queue("localhost", testrun_queue_name(self.testrun_id)) if self.testrun_id2: delete_queue("localhost", testrun_queue_name(self.testrun_id2))
def __init__(self, server_host, testrun_id, response_queue=None): self.log = get_logger_adapter(__name__) self.host = server_host self.testrun_id = testrun_id self.conn = None self.channel = None if response_queue: self.response_queue = response_queue else: self.response_queue = testrun_queue_name(testrun_id)
def tearDown(self): if not DEBUG: self.worker_processes.terminate() self._remove_zip_file(TEST_DEFINITION_ZIP) self._remove_files_created_by_remote_commands() if self.queue: delete_queue("localhost", self.queue) if self.testrun_id: delete_queue("localhost", testrun_queue_name(self.testrun_id))
def _init_amqp(self): """ Make the AMQP connection. Prepare a Queue Start Consuming """ # Disabling "Attribute defined outside __init__" because this method is # called from the __init__ #pylint: disable=W0201 self._testrun_queue = testrun_queue_name(self._testrun_id) self._connection = amqp.Connection(host=self._host, userid=self._username, password=self._password, virtual_host=self._vhost, insist=False) self._channel = self._connection.channel() _init_queue(self._channel, self._testrun_queue, self._testrun_queue, self._testrun_queue) self._channel.basic_consume(queue=self._testrun_queue, callback=self._on_message, no_ack=True)
def _init_amqp(self): """ Make the AMQP connection. Prepare a Queue Start Consuming """ # Disabling "Attribute defined outside __init__" because this method is # called from the __init__ #pylint: disable=W0201 self._testrun_queue = testrun_queue_name(self._testrun_id) self._connection = amqp.Connection(host = self._host, userid = self._username, password = self._password, virtual_host = self._vhost, insist = False) self._channel = self._connection.channel() _init_queue(self._channel, self._testrun_queue, self._testrun_queue, self._testrun_queue) self._channel.basic_consume(queue = self._testrun_queue, callback = self._on_message, no_ack = True)
def tearDown(self): self.worker_processes.terminate() self.cleanup() if self.testrun_id: delete_queue("localhost", testrun_queue_name(self.testrun_id))