Fix minor bugs of get_terminal output caused by a11y tree depth
This commit is contained in:
@@ -17,10 +17,16 @@ from .utils import _match_record, _match_value_to_rule
|
||||
|
||||
|
||||
def check_include_exclude(result: str, rules: Dict[str, List[str]]) -> float:
|
||||
if result is None:
|
||||
return 0.
|
||||
|
||||
print(result, rules)
|
||||
include = rules.get("include", [])
|
||||
exclude = rules.get("exclude", [])
|
||||
return all(r in result for r in include) and all(r not in result for r in exclude)
|
||||
if all(r in result for r in include) and all(r not in result for r in exclude):
|
||||
return 1.
|
||||
else:
|
||||
return 0.
|
||||
|
||||
|
||||
def exact_match(result, rules) -> float:
|
||||
|
||||
Reference in New Issue
Block a user