@@ -24,14 +24,14 @@ def setUp(self):
24
24
@self .registry .register (Condition .REAPPEARED_EVENT )
25
25
@dataclass (frozen = True )
26
26
class TestWorkflowTrigger (DataConditionHandler ):
27
- type = DataConditionHandler .Type .WORKFLOW_TRIGGER
27
+ group = DataConditionHandler .Group .WORKFLOW_TRIGGER
28
28
comparison_json_schema = {"type" : "boolean" }
29
29
30
30
@self .registry .register (Condition .AGE_COMPARISON )
31
31
@dataclass (frozen = True )
32
32
class TestActionFilter (DataConditionHandler ):
33
- type = DataConditionHandler .Type .ACTION_FILTER
34
- filter_group = DataConditionHandler .FilterGroup .ISSUE_ATTRIBUTES
33
+ group = DataConditionHandler .Group .ACTION_FILTER
34
+ subgroup = DataConditionHandler .Subgroup .ISSUE_ATTRIBUTES
35
35
comparison_json_schema = {
36
36
"type" : "object" ,
37
37
"properties" : {
@@ -44,14 +44,14 @@ class TestActionFilter(DataConditionHandler):
44
44
@self .registry .register (Condition .ANOMALY_DETECTION )
45
45
@dataclass (frozen = True )
46
46
class TestDetectorTrigger (DataConditionHandler ):
47
- type = DataConditionHandler .Type .DETECTOR_TRIGGER
47
+ group = DataConditionHandler .Group .DETECTOR_TRIGGER
48
48
comparison_json_schema = {"type" : "boolean" }
49
49
50
50
# This condition should not be included in the response
51
51
@self .registry .register (Condition .EVERY_EVENT )
52
52
@dataclass (frozen = True )
53
53
class TestIgnoredCondition (DataConditionHandler ):
54
- type = DataConditionHandler .Type .WORKFLOW_TRIGGER
54
+ group = DataConditionHandler .Group .WORKFLOW_TRIGGER
55
55
comparison_json_schema = {"type" : "boolean" }
56
56
57
57
def tearDown (self ) -> None :
@@ -61,25 +61,25 @@ def tearDown(self) -> None:
61
61
62
62
@region_silo_test
63
63
class OrganizationDataCondiitonIndexBaseTest (OrganizationDataConditionAPITestCase ):
64
- def test_type_filter (self ):
64
+ def test_group_filter (self ):
65
65
response = self .get_success_response (
66
- self .organization .slug , type = DataConditionHandler .Type .WORKFLOW_TRIGGER
66
+ self .organization .slug , group = DataConditionHandler .Group .WORKFLOW_TRIGGER
67
67
)
68
68
assert len (response .data ) == 1
69
69
assert response .data [0 ] == {
70
- "condition_id " : Condition .REAPPEARED_EVENT .value ,
71
- "type " : DataConditionHandler .Type .WORKFLOW_TRIGGER .value ,
70
+ "type " : Condition .REAPPEARED_EVENT .value ,
71
+ "handler_group " : DataConditionHandler .Group .WORKFLOW_TRIGGER .value ,
72
72
"comparison_json_schema" : {"type" : "boolean" },
73
73
}
74
74
75
75
response = self .get_success_response (
76
- self .organization .slug , type = DataConditionHandler .Type .ACTION_FILTER , status_code = 200
76
+ self .organization .slug , group = DataConditionHandler .Group .ACTION_FILTER , status_code = 200
77
77
)
78
78
assert len (response .data ) == 1
79
79
assert response .data [0 ] == {
80
- "condition_id " : Condition .AGE_COMPARISON .value ,
81
- "type " : DataConditionHandler .Type .ACTION_FILTER .value ,
82
- "filter_group " : DataConditionHandler .FilterGroup .ISSUE_ATTRIBUTES .value ,
80
+ "type " : Condition .AGE_COMPARISON .value ,
81
+ "handler_group " : DataConditionHandler .Group .ACTION_FILTER .value ,
82
+ "handler_subgroup " : DataConditionHandler .Subgroup .ISSUE_ATTRIBUTES .value ,
83
83
"comparison_json_schema" : {
84
84
"type" : "object" ,
85
85
"properties" : {
@@ -90,8 +90,8 @@ def test_type_filter(self):
90
90
},
91
91
}
92
92
93
- def test_invalid_type (self ):
94
- self .get_error_response (self .organization .slug , type = "invalid" , status_code = 400 )
93
+ def test_invalid_group (self ):
94
+ self .get_error_response (self .organization .slug , group = "invalid" , status_code = 400 )
95
95
96
- def test_no_type (self ):
96
+ def test_no_group (self ):
97
97
self .get_error_response (self .organization .slug , status_code = 400 )
0 commit comments