This repository was archived by the owner on Jun 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ def map_keys(
4242 """
4343 mapped_dict = {}
4444 for key , value in dictionary .items ():
45- if isinstance (value , List ) or isinstance (value , Dict ):
46- value_type = type (value )
47- mapped_dict [mapper (key )] = value_type (
45+ if isinstance (value , List ):
46+ mapped_dict [mapper (key )] = [
4847 map_keys (dictionary = sub_dict , mapper = mapper ) for sub_dict in value
49- )
48+ ]
49+ elif isinstance (value , Dict ):
50+ mapped_dict [mapper (key )] = dict (map_keys (dictionary = value , mapper = mapper ))
5051 else :
5152 mapped_dict [mapper (key )] = value
5253
Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ def fetch(
121121 },
122122 "fields" : None ,
123123 },
124+ {
125+ "operation_body" : "models" ,
126+ "arguments" : {"stub" : "zoo:mobilenet_v2-1.0-imagenet-base" },
127+ "fields" : {"analysis" : {"analysisId" : None }},
128+ },
124129 ],
125130)
126131def test_graphql_api_response (query_args : Dict [str , Any ]):
Original file line number Diff line number Diff line change 172172 ),
173173 },
174174 ),
175+ (
176+ {
177+ "operation_body" : "models" ,
178+ "arguments" : {"stub" : "zoo:mobilenet_v2-1.0-imagenet-base" },
179+ "fields" : {"analysis" : {"analysisId" : None }},
180+ },
181+ {
182+ "operation_body" : "models" ,
183+ "arguments" : '(stub: "zoo:mobilenet_v2-1.0-imagenet-base",)' ,
184+ "fields" : "analysis { analysisId } " ,
185+ },
186+ ),
175187 ],
176188)
177189def test_query_parser (
You can’t perform that action at this time.
0 commit comments