Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Ran Isenberg committed Aug 10, 2021
1 parent de9971d commit 207cc2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _evaluate_conditions(
return False # context doesn't match condition

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

def _evaluate_rules(
self, *, feature_name: str, context: Dict[str, Any], feat_default: bool, rules: Dict[str, Any]
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/feature_flags/test_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ def test_flags_conditions_no_match(mocker, config):

# check that a rule can match when it has multiple conditions, see rule name for further explanation
def test_flags_conditions_rule_not_match_multiple_conditions_match_only_one_condition(mocker, config):
expected_value = True
expected_value = False
tenant_id_val = "6"
username_val = "a"
mocked_app_config_schema = {
"my_feature": {
"default": True,
"default": expected_value,
"rules": {
"tenant id equals 6 and username is a": {
"when_match": False,
"when_match": True,
"conditions": [
{
"action": RuleAction.EQUALS.value, # this condition matches
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_flags_conditions_rule_match_equal_multiple_conditions(mocker, config):
username_val = "a"
mocked_app_config_schema = {
"my_feature": {
"default": False,
"default": True,
"rules": {
"tenant id equals 6 and username is a": {
"when_match": expected_value,
Expand Down

0 comments on commit 207cc2b

Please sign in to comment.