@@ -37,7 +37,7 @@ def test_toggles_rule_does_not_match(mocker, config):
37
37
{
38
38
"rule_name" : "tenant id equals 345345435" ,
39
39
"value_when_applies" : False ,
40
- "restrictions " : [
40
+ "conditions " : [
41
41
{
42
42
"action" : ACTION .EQUALS .value ,
43
43
"key" : "tenant_id" ,
@@ -57,7 +57,7 @@ def test_toggles_rule_does_not_match(mocker, config):
57
57
58
58
# this test checks that if you try to get a feature that doesn't exist in the schema,
59
59
# you get the default value of False that was sent to the get_feature_toggle API
60
- def test_toggles_no_restrictions_feature_does_not_exist (mocker , config ):
60
+ def test_toggles_no_conditions_feature_does_not_exist (mocker , config ):
61
61
expected_value = False
62
62
mocked_app_config_schema = {"features" : {"my_fake_feature" : {"feature_default_value" : True }}}
63
63
@@ -79,7 +79,7 @@ def test_toggles_no_rules(mocker, config):
79
79
80
80
81
81
# check a case where the feature exists but the rule doesn't match so we revert to the default value of the feature
82
- def test_toggles_restrictions_no_match (mocker , config ):
82
+ def test_toggles_conditions_no_match (mocker , config ):
83
83
expected_value = True
84
84
mocked_app_config_schema = {
85
85
"features" : {
@@ -89,7 +89,7 @@ def test_toggles_restrictions_no_match(mocker, config):
89
89
{
90
90
"rule_name" : "tenant id equals 345345435" ,
91
91
"value_when_applies" : False ,
92
- "restrictions " : [
92
+ "conditions " : [
93
93
{
94
94
"action" : ACTION .EQUALS .value ,
95
95
"key" : "tenant_id" ,
@@ -110,8 +110,8 @@ def test_toggles_restrictions_no_match(mocker, config):
110
110
assert toggle == expected_value
111
111
112
112
113
- # check that a rule can match when it has multiple restrictions , see rule name for further explanation
114
- def test_toggles_restrictions_rule_match_equal_multiple_restrictions (mocker , config ):
113
+ # check that a rule can match when it has multiple conditions , see rule name for further explanation
114
+ def test_toggles_conditions_rule_match_equal_multiple_conditions (mocker , config ):
115
115
expected_value = False
116
116
tenant_id_val = "6"
117
117
username_val = "a"
@@ -123,9 +123,9 @@ def test_toggles_restrictions_rule_match_equal_multiple_restrictions(mocker, con
123
123
{
124
124
"rule_name" : "tenant id equals 6 and username is a" ,
125
125
"value_when_applies" : expected_value ,
126
- "restrictions " : [
126
+ "conditions " : [
127
127
{
128
- "action" : ACTION .EQUALS .value , # this rule will match, it has multiple restrictions
128
+ "action" : ACTION .EQUALS .value , # this rule will match, it has multiple conditions
129
129
"key" : "tenant_id" ,
130
130
"value" : tenant_id_val ,
131
131
},
@@ -152,10 +152,10 @@ def test_toggles_restrictions_rule_match_equal_multiple_restrictions(mocker, con
152
152
assert toggle == expected_value
153
153
154
154
155
- # check a case when rule doesn't match and it has multiple restrictions ,
155
+ # check a case when rule doesn't match and it has multiple conditions ,
156
156
# different tenant id causes the rule to not match.
157
157
# default value of the feature in this case is True
158
- def test_toggles_restrictions_no_rule_match_equal_multiple_restrictions (mocker , config ):
158
+ def test_toggles_conditions_no_rule_match_equal_multiple_conditions (mocker , config ):
159
159
expected_val = True
160
160
mocked_app_config_schema = {
161
161
"features" : {
@@ -165,7 +165,7 @@ def test_toggles_restrictions_no_rule_match_equal_multiple_restrictions(mocker,
165
165
{
166
166
"rule_name" : "tenant id equals 645654 and username is a" , # rule will not match
167
167
"value_when_applies" : False ,
168
- "restrictions " : [
168
+ "conditions " : [
169
169
{
170
170
"action" : ACTION .EQUALS .value ,
171
171
"key" : "tenant_id" ,
@@ -190,7 +190,7 @@ def test_toggles_restrictions_no_rule_match_equal_multiple_restrictions(mocker,
190
190
191
191
192
192
# check rule match for multiple of action types
193
- def test_toggles_restrictions_rule_match_multiple_actions_multiple_rules_multiple_restrictions (mocker , config ):
193
+ def test_toggles_conditions_rule_match_multiple_actions_multiple_rules_multiple_conditions (mocker , config ):
194
194
expected_value_first_check = True
195
195
expected_value_second_check = False
196
196
expected_value_third_check = False
@@ -203,7 +203,7 @@ def test_toggles_restrictions_rule_match_multiple_actions_multiple_rules_multipl
203
203
{
204
204
"rule_name" : "tenant id equals 6 and username startswith a" ,
205
205
"value_when_applies" : expected_value_first_check ,
206
- "restrictions " : [
206
+ "conditions " : [
207
207
{
208
208
"action" : ACTION .EQUALS .value ,
209
209
"key" : "tenant_id" ,
@@ -219,7 +219,7 @@ def test_toggles_restrictions_rule_match_multiple_actions_multiple_rules_multipl
219
219
{
220
220
"rule_name" : "tenant id equals 4446 and username startswith a and endswith z" ,
221
221
"value_when_applies" : expected_value_second_check ,
222
- "restrictions " : [
222
+ "conditions " : [
223
223
{
224
224
"action" : ACTION .EQUALS .value ,
225
225
"key" : "tenant_id" ,
@@ -284,7 +284,7 @@ def test_toggles_match_rule_with_contains_action(mocker, config):
284
284
{
285
285
"rule_name" : "tenant id is contained in [6,2] " ,
286
286
"value_when_applies" : expected_value ,
287
- "restrictions " : [
287
+ "conditions " : [
288
288
{
289
289
"action" : ACTION .CONTAINS .value ,
290
290
"key" : "tenant_id" ,
@@ -315,7 +315,7 @@ def test_toggles_no_match_rule_with_contains_action(mocker, config):
315
315
{
316
316
"rule_name" : "tenant id is contained in [6,2] " ,
317
317
"value_when_applies" : True ,
318
- "restrictions " : [
318
+ "conditions " : [
319
319
{
320
320
"action" : ACTION .CONTAINS .value ,
321
321
"key" : "tenant_id" ,
@@ -346,7 +346,7 @@ def test_multiple_features_enabled(mocker, config):
346
346
{
347
347
"rule_name" : "tenant id is contained in [6,2] " ,
348
348
"value_when_applies" : True ,
349
- "restrictions " : [
349
+ "conditions " : [
350
350
{
351
351
"action" : ACTION .CONTAINS .value ,
352
352
"key" : "tenant_id" ,
@@ -378,7 +378,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
378
378
{
379
379
"rule_name" : "tenant id is contained in [6,2] " ,
380
380
"value_when_applies" : True ,
381
- "restrictions " : [
381
+ "conditions " : [
382
382
{
383
383
"action" : ACTION .CONTAINS .value ,
384
384
"key" : "tenant_id" ,
@@ -400,7 +400,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
400
400
{
401
401
"rule_name" : "tenant id equals 7" ,
402
402
"value_when_applies" : False ,
403
- "restrictions " : [
403
+ "conditions " : [
404
404
{
405
405
"action" : ACTION .EQUALS .value ,
406
406
"key" : "tenant_id" ,
0 commit comments