示例#1
0
文件: snolla.py 项目: nblock/snolla
    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))
示例#2
0
 def test_match(self):
     self.assertEqual('comment', utils.get_bugzilla_task_for_action('see', self.tasks))
示例#3
0
 def test_no_match(self):
     self.assertIsNone(utils.get_bugzilla_task_for_action('nonono', self.tasks))
示例#4
0
 def test_empty_action(self):
     self.assertIsNone(utils.get_bugzilla_task_for_action('', self.tasks))