def test_path_rules_specifier(self): all_categories = style_categories() for (sub_paths, path_rules) in PATH_RULES_SPECIFIER: self.assertTrue(isinstance(path_rules, tuple), "Checking: " + str(path_rules)) validate_filter_rules(path_rules, self._all_categories()) # Try using the path specifier (as an "end-to-end" check). config = FilterConfiguration(path_specific=PATH_RULES_SPECIFIER) self.assertTrue(config.should_check("xxx_any_category", "xxx_non_matching_path")) self.assertTrue(config.should_check("xxx_any_category", "WebKitTools/WebKitAPITest/")) self.assertFalse(config.should_check("build/include", "WebKitTools/WebKitAPITest/")) self.assertFalse(config.should_check("readability/naming", "WebKit/qt/tests/qwebelement/tst_qwebelement.cpp"))
def test_path_rules_specifier(self): all_categories = style_categories() for (sub_paths, path_rules) in PATH_RULES_SPECIFIER: self.assertTrue(isinstance(path_rules, tuple), "Checking: " + str(path_rules)) validate_filter_rules(path_rules, self._all_categories()) # Try using the path specifier (as an "end-to-end" check). config = FilterConfiguration(path_specific=PATH_RULES_SPECIFIER) self.assertTrue( config.should_check("xxx_any_category", "xxx_non_matching_path")) self.assertTrue( config.should_check("xxx_any_category", "WebKitTools/WebKitAPITest/")) self.assertFalse( config.should_check("build/include", "WebKitTools/WebKitAPITest/")) self.assertFalse( config.should_check( "readability/naming", "WebKit/qt/tests/qwebelement/tst_qwebelement.cpp"))
def _all_categories(self): return style.style_categories()