File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
cads_processing_api_service Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ def extract_groups_labels(
35
35
36
36
37
37
def extract_labels (input_cds_schema : dict [str , Any ]) -> dict [str , str ]:
38
- details = input_cds_schema ["details" ]
38
+ details : dict [ str , Any ] = input_cds_schema ["details" ]
39
39
if "groups" in details :
40
40
values = extract_groups_labels (details ["groups" ])
41
41
else :
42
- values = details [ "labels" ]
42
+ values = details . get ( "labels" , {})
43
43
return values
44
44
45
45
Original file line number Diff line number Diff line change 60
60
},
61
61
"type" : "StringListArrayWidget" ,
62
62
},
63
+ "free_edition_widget" : {
64
+ "type" : "FreeEditionWidget" ,
65
+ "details" : {},
66
+ },
63
67
}
64
68
65
69
@@ -116,6 +120,13 @@ def test_extract_labels() -> None:
116
120
)
117
121
assert res_output == exp_output
118
122
123
+ test_inputs_cds_schema = TEST_INPUT_CDS_SCHEMAS ["free_edition_widget" ]
124
+ exp_output = {}
125
+ res_output = cads_processing_api_service .translators .extract_labels (
126
+ test_inputs_cds_schema
127
+ )
128
+ assert res_output == exp_output
129
+
119
130
120
131
def test_translate_string_list () -> None :
121
132
test_input = TEST_INPUT_CDS_SCHEMAS ["string_list" ]
You can’t perform that action at this time.
0 commit comments