def handle_extracted_action(self, action, bugid, commit): """Handle a single extracted action and bugid.""" self.log.info('Found action "{}" for bug id {}.'.format(action, bugid)) # Find suitable Bugzilla tasks for the extracted action. task = utils.get_bugzilla_task_for_action(action, utils.get_task_dict_from_config(self.config)) if task: self.log.info('The action "{}" matches the Bugzilla task {}.'.format(action, task)) self.bugzilla_task_queue.put(utils.create_bugzilla_task(task, bugid, commit)) else: self.log.warning('The action "{}" does not match any Bugzilla task.'.format(action))
def test_match(self): self.assertEqual('comment', utils.get_bugzilla_task_for_action('see', self.tasks))
def test_no_match(self): self.assertIsNone(utils.get_bugzilla_task_for_action('nonono', self.tasks))
def test_empty_action(self): self.assertIsNone(utils.get_bugzilla_task_for_action('', self.tasks))