fix: object client methods can receive dict or list as default_value (#134)

Signed-off-by: Federico Bond <federicobond@gmail.com>
This commit is contained in:
Federico Bond 2023-07-06 12:38:22 -03:00 committed by GitHub
parent d31b531ae8
commit 291581fbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -182,7 +182,7 @@ class OpenFeatureClient:
def get_object_value(
self,
flag_key: str,
default_value: dict,
default_value: typing.Union[dict, list],
evaluation_context: typing.Optional[EvaluationContext] = None,
flag_evaluation_options: typing.Optional[FlagEvaluationOptions] = None,
) -> dict:
@ -197,7 +197,7 @@ class OpenFeatureClient:
def get_object_details(
self,
flag_key: str,
default_value: dict,
default_value: typing.Union[dict, list],
evaluation_context: typing.Optional[EvaluationContext] = None,
flag_evaluation_options: typing.Optional[FlagEvaluationOptions] = None,
) -> FlagEvaluationDetails:

View File

@ -61,6 +61,11 @@ def test_should_get_flag_value_based_on_method_type(
},
"get_object_details",
),
(
list,
["string1", "string2"],
"get_object_details",
),
),
)
def test_should_get_flag_detail_based_on_method_type(