def test_clasify(self): cmd = "cheker_a,Category,cheker,W1234,OtherCategory,E2345" compare(namespace.clasify(cmd), (['W1234', 'E2345'], ['cheker_a', 'cheker' ], ['Category', 'OtherCategory'])) compare(namespace.clasify("W1234"), (['W1234'], [], [])) compare(namespace.clasify("cheker"), ([], ['cheker'], [])) compare(namespace.clasify("Category"), ([], [], ['Category']))
def test_clasify(self): cmd = "cheker_a,Category,cheker,W1234,OtherCategory,E2345" compare(namespace.clasify(cmd), (['W1234', 'E2345'], ['cheker_a', 'cheker'], ['Category', 'OtherCategory'])) compare(namespace.clasify("W1234"), (['W1234'], [], [])) compare(namespace.clasify("cheker"), ([], ['cheker'], [])) compare(namespace.clasify("Category"), ([], [], ['Category']))
def compose(self, pluggins, enables, disables): """ Extends configuration with additional parameters (command line options) """ messages, echeckers, categories = namespace.clasify(enables) self.categories += categories self.checkers += [(i, {}) for i in echeckers] self.messages += messages messages, checkers, categories = namespace.clasify(disables) self.disable_categories += categories self.disable_checkers += \ [c.name for c in pluggins if c.category in self.disable_categories and c.name not in echeckers] self.disable_checkers += checkers self.disable_messages += messages self.checkers_ids = [i[0] for i in self.checkers]