Skip to content

Commit f025789

Browse files
committed
refactor: get_all_enabled_feature_toggles to get_enabled_features
1 parent 38c7bd1 commit f025789

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: aws_lambda_powertools/utilities/feature_toggles/feature_flags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def evaluate(self, *, feature_name: str, context: Optional[Dict[str, Any]] = Non
166166
rules=cast(List, rules_list),
167167
)
168168

169-
def get_all_enabled_feature_toggles(self, *, context: Optional[Dict[str, Any]] = None) -> List[str]:
169+
def get_enabled_features(self, *, context: Optional[Dict[str, Any]] = None) -> List[str]:
170170
"""Get all enabled feature toggles while also taking into account rule_context
171171
(when a feature has defined rules)
172172

Diff for: tests/functional/feature_toggles/test_feature_toggles.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_multiple_features_enabled(mocker, config):
360360
},
361361
}
362362
conf_store = init_configuration_store(mocker, mocked_app_config_schema, config)
363-
enabled_list: List[str] = conf_store.get_all_enabled_feature_toggles(context={"tenant_id": "6", "username": "a"})
363+
enabled_list: List[str] = conf_store.get_enabled_features(context={"tenant_id": "6", "username": "a"})
364364
assert enabled_list == expected_value
365365

366366

@@ -409,7 +409,7 @@ def test_multiple_features_only_some_enabled(mocker, config):
409409
},
410410
}
411411
conf_store = init_configuration_store(mocker, mocked_app_config_schema, config)
412-
enabled_list: List[str] = conf_store.get_all_enabled_feature_toggles(context={"tenant_id": "6", "username": "a"})
412+
enabled_list: List[str] = conf_store.get_enabled_features(context={"tenant_id": "6", "username": "a"})
413413
assert enabled_list == expected_value
414414

415415

@@ -430,8 +430,8 @@ def test_get_all_enabled_feature_toggles_handles_error(mocker, config):
430430
schema_fetcher = init_fetcher_side_effect(mocker, config, GetParameterError())
431431
conf_store = FeatureFlags(schema_fetcher)
432432

433-
# WHEN calling get_all_enabled_feature_toggles
434-
toggles = conf_store.get_all_enabled_feature_toggles(context=None)
433+
# WHEN calling get_enabled_features
434+
toggles = conf_store.get_enabled_features(context=None)
435435

436436
# THEN handle the error and return an empty list
437437
assert toggles == []

0 commit comments

Comments
 (0)