You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the list of test cases below, the expected_value is assigned as the default value which is returned when the condition does not match. The test only passes because both the expected and non-expected values are the same - True meaning that the test cannot fail ever.
test_flags_not_equal_match
test_flags_less_than_match
test_flags_less_than_or_equal_match_1
test_flags_less_than_or_equal_match_2
test_flags_greater_than_match
test_flags_greater_than_or_equal_match_1
test_flags_greater_than_or_equal_match_2
Code snippet
# One of the test cases from above listdeftest_flags_not_equal_match(mocker, config):
expected_value=Truemocked_app_config_schema= {
"my_feature": {
"default": expected_value,
"rules": {
"tenant id not equals 345345435": {
"when_match": True,
"conditions": [
{
"action": RuleAction.NOT_EQUALS.value,
"key": "tenant_id",
"value": "345345435",
}
],
}
},
}
}
feature_flags=init_feature_flags(mocker, mocked_app_config_schema, config)
toggle=feature_flags.evaluate(name="my_feature", context={"tenant_id": "", "username": "a"}, default=False)
asserttoggle==expected_value
Possible Solution
For match cases - expected_value, must be assigned to the when_match of condition rather than default and default must return False
Uh oh!
There was an error while loading. Please reload this page.
Expected Behaviour
Feature Flags
match
type test cases must have the non-expected value as default and the conditionwhen_match
must be equal toexpected_value
reference - #2052 (review)
Current Behaviour
For the list of test cases below, the
expected_value
is assigned as thedefault
value which is returned when the condition does not match. The test only passes because both the expected and non-expected values are the same -True
meaning that the test cannot fail ever.Code snippet
Possible Solution
For
match
cases - expected_value, must be assigned to thewhen_match
of condition rather thandefault
anddefault
must returnFalse
Steps to Reproduce
N/A
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.6
Packaging format used
PyPi
Debugging logs
No response
The text was updated successfully, but these errors were encountered: