Beispiel #1
0
    def fixes_configuration_data(self):
        """
        Return True if the commit fixes configuration data.

        Returns
        -------
        bool
            True if the commit fixes configuration data. False, otherwise.

        """

        for sentence in self.sentences:
            sentence = ' '.join(sentence)
            sentence_dep = ' '.join(utils.get_head_dependents(sentence))

            if rules.has_defect_pattern(sentence) \
                    and (rules.has_storage_configuration_pattern(sentence_dep)
                         or rules.has_file_configuration_pattern(sentence_dep)
                         or rules.has_network_configuration_pattern(sentence_dep)
                         or rules.has_user_configuration_pattern(sentence_dep)
                         or rules.has_cache_configuration_pattern(sentence_dep)
                         or self.is_data_changed()):
                return True

        return False
 def test_has_network_configuration_pattern_false():
     assert not rules.has_network_configuration_pattern('refactored code')
 def test_has_network_configuration_pattern_true():
     assert rules.has_network_configuration_pattern('fix ip address binding')