Skip to content

Commit 4bfe2a8

Browse files
committed
refactor(schema): rename value_when_applies to when_match
1 parent 327a4ae commit 4bfe2a8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

aws_lambda_powertools/utilities/feature_flags/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
FEATURE_DEFAULT_VAL_KEY = "default"
1313
CONDITIONS_KEY = "conditions"
1414
RULE_NAME_KEY = "rule_name"
15-
RULE_DEFAULT_VALUE = "value_when_applies"
15+
RULE_DEFAULT_VALUE = "when_match"
1616
CONDITION_KEY = "key"
1717
CONDITION_VALUE = "value"
1818
CONDITION_ACTION = "action"

tests/functional/feature_toggles/test_feature_toggles.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_toggles_rule_does_not_match(mocker, config):
5353
"rules": [
5454
{
5555
"rule_name": "tenant id equals 345345435",
56-
"value_when_applies": False,
56+
"when_match": False,
5757
"conditions": [
5858
{
5959
"action": RuleAction.EQUALS.value,
@@ -103,7 +103,7 @@ def test_toggles_conditions_no_match(mocker, config):
103103
"rules": [
104104
{
105105
"rule_name": "tenant id equals 345345435",
106-
"value_when_applies": False,
106+
"when_match": False,
107107
"conditions": [
108108
{
109109
"action": RuleAction.EQUALS.value,
@@ -133,7 +133,7 @@ def test_toggles_conditions_rule_match_equal_multiple_conditions(mocker, config)
133133
"rules": [
134134
{
135135
"rule_name": "tenant id equals 6 and username is a",
136-
"value_when_applies": expected_value,
136+
"when_match": expected_value,
137137
"conditions": [
138138
{
139139
"action": RuleAction.EQUALS.value, # this rule will match, it has multiple conditions
@@ -175,7 +175,7 @@ def test_toggles_conditions_no_rule_match_equal_multiple_conditions(mocker, conf
175175
"rules": [
176176
{
177177
"rule_name": "tenant id equals 645654 and username is a", # rule will not match
178-
"value_when_applies": False,
178+
"when_match": False,
179179
"conditions": [
180180
{
181181
"action": RuleAction.EQUALS.value,
@@ -211,7 +211,7 @@ def test_toggles_conditions_rule_match_multiple_actions_multiple_rules_multiple_
211211
"rules": [
212212
{
213213
"rule_name": "tenant id equals 6 and username startswith a",
214-
"value_when_applies": expected_value_first_check,
214+
"when_match": expected_value_first_check,
215215
"conditions": [
216216
{
217217
"action": RuleAction.EQUALS.value,
@@ -227,7 +227,7 @@ def test_toggles_conditions_rule_match_multiple_actions_multiple_rules_multiple_
227227
},
228228
{
229229
"rule_name": "tenant id equals 4446 and username startswith a and endswith z",
230-
"value_when_applies": expected_value_second_check,
230+
"when_match": expected_value_second_check,
231231
"conditions": [
232232
{
233233
"action": RuleAction.EQUALS.value,
@@ -280,7 +280,7 @@ def test_toggles_match_rule_with_contains_action(mocker, config):
280280
"rules": [
281281
{
282282
"rule_name": "tenant id is contained in [6, 2]",
283-
"value_when_applies": expected_value,
283+
"when_match": expected_value,
284284
"conditions": [
285285
{
286286
"action": RuleAction.CONTAINS.value,
@@ -307,7 +307,7 @@ def test_toggles_no_match_rule_with_contains_action(mocker, config):
307307
"rules": [
308308
{
309309
"rule_name": "tenant id is contained in [8, 2]",
310-
"value_when_applies": True,
310+
"when_match": True,
311311
"conditions": [
312312
{
313313
"action": RuleAction.CONTAINS.value,
@@ -334,7 +334,7 @@ def test_multiple_features_enabled(mocker, config):
334334
"rules": [
335335
{
336336
"rule_name": "tenant id is contained in [6, 2]",
337-
"value_when_applies": True,
337+
"when_match": True,
338338
"conditions": [
339339
{
340340
"action": RuleAction.CONTAINS.value,
@@ -367,7 +367,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
367367
"rules": [
368368
{
369369
"rule_name": "tenant id is contained in [6, 2]",
370-
"value_when_applies": True,
370+
"when_match": True,
371371
"conditions": [
372372
{
373373
"action": RuleAction.CONTAINS.value,
@@ -389,7 +389,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
389389
"rules": [
390390
{
391391
"rule_name": "tenant id equals 7",
392-
"value_when_applies": False,
392+
"when_match": False,
393393
"conditions": [
394394
{
395395
"action": RuleAction.EQUALS.value,

0 commit comments

Comments
 (0)