-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds human review to experimental alerts (#229)
* Adds human review to experimental alerts * Automatically reformatting code --------- Co-authored-by: Auto-format Bot <[email protected]>
- Loading branch information
1 parent
af19a50
commit d0d975c
Showing
2 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ | |
|
||
|
||
def test_create_action(gl: ExperimentalApi): | ||
# We first clear out any rules in case the account has any left over from a previous test | ||
gl.delete_all_rules() | ||
# use a unique name for the alert | ||
name = f"Test {datetime.utcnow()}" | ||
det = gl.get_or_create_detector(name, "test_query") | ||
rule = gl.create_rule(det, "test_rule", "EMAIL", "[email protected]") | ||
rule = gl.create_rule(det, f"test_rule_{name}", "EMAIL", "[email protected]") | ||
rule2 = gl.get_rule(rule.id) | ||
assert rule == rule2 | ||
gl.delete_rule(rule.id) | ||
|
@@ -35,3 +34,14 @@ def test_get_all_actions(gl: ExperimentalApi): | |
assert num_deleted == num_test_rules | ||
rules = gl.list_rules() | ||
assert rules.count == 0 | ||
|
||
|
||
def test_create_action_with_human_review(gl: ExperimentalApi): | ||
name = f"Test {datetime.utcnow()}" | ||
det = gl.get_or_create_detector(name, "test_query") | ||
rule = gl.create_rule(det, f"test_rule_{name}", "EMAIL", "[email protected]", human_review_required=True) | ||
rule2 = gl.get_rule(rule.id) | ||
assert rule == rule2 | ||
gl.delete_rule(rule.id) | ||
with pytest.raises(NotFoundException) as _: | ||
gl.get_rule(rule.id) |