Example #1
0
 def test_categoty_re(self):
     self.assertIsNotNone(namespace.valid_category_id("ValidName"))
     self.assertIsNotNone(namespace.valid_category_id("Validname"))
     with ShouldRaise(
             NameError("Id 'Invalid_name' is not allowed "
                       "for category")):
         namespace.valid_category_id("Invalid_name")
Example #2
0
 def _handle_disable_categories(self):
     """ Parses config and returns categories ids for disabling """
     rez_cat = []
     for category in self.disable_categories:
         if category in self.config:
             name = self.config[category]['category']
         else:
             name = category
         rez_cat.append(namespace.valid_category_id(name))
     return rez_cat
Example #3
0
 def _handle_categories(self):
     """
     Hands loading of categories and theirs entries from config file.
     """
     rez_cat = []
     for category in self.categories:
         if category in self.disable_categories:
             continue
         if category in self.config:
             name = namespace.valid_category_id(
                 self.config[category]['category'])
             if name in self.disable_categories:
                 continue
             rez = enables_disables(self.config[category])
             # category defined as section but has no configuration so take
             # its name only
             if not any(rez):
                 rez_cat.append(name)
             else:
                 self.checkers += rez[0]
                 self.disable_checkers += rez[1]
         else:
             rez_cat.append(namespace.valid_category_id(category))
     return rez_cat
Example #4
0
 def test_categoty_re(self):
     self.assertIsNotNone(namespace.valid_category_id("ValidName"))
     self.assertIsNotNone(namespace.valid_category_id("Validname"))
     with ShouldRaise(NameError("Id 'Invalid_name' is not allowed "
                                "for category")):
         namespace.valid_category_id("Invalid_name")