Add rule api and test

This commit is contained in:
WQY\qiong
2022-10-29 19:09:34 +08:00
parent 44475cf005
commit 1109ca4b6d
5 changed files with 59 additions and 14 deletions

View File

@@ -429,6 +429,21 @@ def set_control(name: str, cs: ChangeSet) -> ChangeSet:
return api.set_control(name, cs)
############################################################
# rule 12.[CONTROLS]
############################################################
def get_rule_schema(name: str) -> dict[str, dict[str, Any]]:
return api.get_rule_schema(name)
def get_rule(name: str) -> dict[str, Any]:
return api.get_rule(name)
# example: set_rule(p, ChangeSet({'rule': 'x'}))
def set_rule(name: str, cs: ChangeSet) -> ChangeSet:
return api.set_rule(name, cs)
############################################################
# emitter 16.[EMITTERS]
############################################################