Пример #1
0
    def process(self, commit):
        """Process a commit."""
        if not self.check_allowed_origins(commit):
            return

        # Extract action and bugid from commit.
        action_list = utils.extract_actions(commit['message'], self.config['general']['extract_regex'])
        if not action_list:
            self.log.warning('Could not find any action/bugid in commit {id}.'.format(**commit))
            return

        # Handle extracted actions
        for action, bugid in action_list:
            self.handle_extracted_action(action, bugid, commit)
Пример #2
0
 def test_action_as_lower_str(self):
     self.assertListEqual([('fixes', 2)],
             utils.extract_actions('well (FiXES #2).', self.regex))
Пример #3
0
 def test_action_empty(self):
     self.assertListEqual([('', 2)],
             utils.extract_actions('#2).', self.regex))
Пример #4
0
 def test_bugid_empty(self):
     self.assertListEqual([],
             utils.extract_actions('ixes 18).', self.regex))
Пример #5
0
 def test_multiple_values(self):
     self.assertListEqual([('fixes', 18), ('closes', 20)],
             utils.extract_actions('fixes #18 and closes:#20', self.regex))
Пример #6
0
 def test_single_action(self):
     self.assertListEqual([('fixes', 18)],
             utils.extract_actions('comment (fixes: #18).', self.regex))
Пример #7
0
 def test_empty_message(self):
     self.assertListEqual([], utils.extract_actions('', self.regex))