Skip to content

Commit 207cc2b

Browse files
author
Ran Isenberg
committed
a
1 parent de9971d commit 207cc2b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

aws_lambda_powertools/utilities/feature_flags/feature_flags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _evaluate_conditions(
8484
return False # context doesn't match condition
8585

8686
logger.debug(f"rule matched, rule_name={rule_name}, rule_value={rule_match_value}, name={feature_name}")
87-
return rule_match_value
87+
return True
8888

8989
def _evaluate_rules(
9090
self, *, feature_name: str, context: Dict[str, Any], feat_default: bool, rules: Dict[str, Any]

tests/functional/feature_flags/test_feature_flags.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ def test_flags_conditions_no_match(mocker, config):
122122

123123
# check that a rule can match when it has multiple conditions, see rule name for further explanation
124124
def test_flags_conditions_rule_not_match_multiple_conditions_match_only_one_condition(mocker, config):
125-
expected_value = True
125+
expected_value = False
126126
tenant_id_val = "6"
127127
username_val = "a"
128128
mocked_app_config_schema = {
129129
"my_feature": {
130-
"default": True,
130+
"default": expected_value,
131131
"rules": {
132132
"tenant id equals 6 and username is a": {
133-
"when_match": False,
133+
"when_match": True,
134134
"conditions": [
135135
{
136136
"action": RuleAction.EQUALS.value, # this condition matches
@@ -165,7 +165,7 @@ def test_flags_conditions_rule_match_equal_multiple_conditions(mocker, config):
165165
username_val = "a"
166166
mocked_app_config_schema = {
167167
"my_feature": {
168-
"default": False,
168+
"default": True,
169169
"rules": {
170170
"tenant id equals 6 and username is a": {
171171
"when_match": expected_value,

0 commit comments

Comments
 (0)