def test_single_task_with_two_keywords_disabled(self): raw_config = [ "[tasks]", "[[comment]]", "enabled = False", "keywords = 'see', 'comment'"] config = ConfigObj(raw_config) self.assertDictEqual({}, utils.get_task_dict_from_config(config))
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_two_tasks_with_just_one_task_enabled(self): raw_config = [ "[tasks]", "[[comment]]", "enabled = True", "keywords = 'see',", "[[bar]]", "enabled = no", "keywords = 'foo',"] config = ConfigObj(raw_config) self.assertDictEqual({'comment': ['see']}, utils.get_task_dict_from_config(config))
def test_empty_config(self): raw_config = ["[tasks]"] config = ConfigObj(raw_config) self.assertDictEqual({}, utils.get_task_dict_from_config(config))