def check_empty_include_rules(request): obj = Obj() obj.info.unstable = True obj.info.priority = 2 obj.tags = {'chrome'} selector = Selector() selector.validate(obj)
def check_third_include_match(request): obj = Obj() obj.info.unstable = True obj.info.priority = 2 obj.tags = {'chrome'} selector = Selector() selector.include("not unstable") selector.include("priority is 3") selector.include("with tag chrome") selector.validate(obj)
def check_no_include_match(request): obj = Obj() obj.info.unstable = True obj.info.priority = 2 obj.tags = {'chrome'} selector = Selector() selector.include("not unstable") selector.include("priority is 3") selector.include("with tag firefox") try: selector.validate(obj) except NoInclusionRuleMet as e: pass else: raise AssertionError()
def check_third_exclude_match(request): obj = Obj() obj.info.unstable = True obj.info.priority = 2 obj.tags = {'chrome'} selector = Selector() selector.exclude("not unstable") selector.exclude("priority is 3") selector.exclude("with tag chrome") try: selector.validate(obj) except ExclusionRuleMet as e: assert e.rule.rule_str == "with tag chrome" else: raise AssertionError()
def check_empty_exclude_rules(request): obj = Obj() selector = Selector() selector.validate(obj)