def test_unknown_check(ruleset_unknown_check): checks = colin.get_checks(ruleset=ruleset_unknown_check) assert checks assert len(checks) == 2 for check in checks: if check.name == 'i_forgot_the_name': assert isinstance(check, NotLoadedCheck) elif check.name == 'maintainer_label': assert isinstance(check, LabelAbstractCheck) else: assert False
def test_skip(ruleset): checks = colin.get_checks(ruleset=ruleset, skips=["name_label", "help_label"]) assert len(checks) == 2 for check in checks: assert check.name in ["com.redhat.component_label", "maintainer_label"]
def test_unknown_check(ruleset_unknown_check): with pytest.raises(ColinRulesetException) as ex: colin.get_checks(ruleset=ruleset_unknown_check) assert str( ex.value ) == "Check i_forgot_the_name can't be loaded, we couldn't find it."
def test_coupled_ruleset(ruleset_coupled): checks = colin.get_checks(ruleset=ruleset_coupled) assert checks assert len(checks) == 3 for c in checks: assert "required" in c.tags
def test_get_checks_directly(ruleset): checks = colin.get_checks(ruleset=ruleset) assert checks