File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -397,3 +397,39 @@ class CustomMetadata(TypedDict):
397397
398398 # Then
399399 assert result ["segments" ][0 ]["metadata" ] is segment_metadata
400+
401+
402+ def test_segment_metadata_generic_type__default__returns_expected () -> None :
403+ # Given
404+ segment_metadata = {"hello" : object ()}
405+
406+ # we don't specify generic type, but mypy is happy with this
407+ evaluation_context : EvaluationContext = {
408+ "environment" : {"key" : "api-key" , "name" : "" },
409+ "segments" : {
410+ "1" : {
411+ "key" : "1" ,
412+ "name" : "my_segment" ,
413+ "rules" : [
414+ {
415+ "type" : "ALL" ,
416+ "conditions" : [
417+ {
418+ "property" : "$.environment.name" ,
419+ "operator" : "EQUAL" ,
420+ "value" : "" ,
421+ }
422+ ],
423+ "rules" : [],
424+ }
425+ ],
426+ "metadata" : segment_metadata ,
427+ },
428+ },
429+ }
430+
431+ # When
432+ result = get_evaluation_result (evaluation_context )
433+
434+ # Then
435+ assert result ["segments" ][0 ]["metadata" ] is segment_metadata
You can’t perform that action at this time.
0 commit comments