Skip to content

Commit

Permalink
Make sure get_mapping_by_name returns dict as specified in method header
Browse files Browse the repository at this point in the history
  • Loading branch information
lenggi committed Mar 28, 2024
1 parent bcb70f7 commit 28d00a7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,12 @@ def get_mapping_by_name(gw_session: GatewaySession, name: str) -> dict:
'''
path = f'/configuration/mappings?filter=name=={name}'
res = get(gw_session, path, exp_code=200)
return res.json().get('data')

candidate_list = res.json().get('data')
if len(candidate_list) == 1:
return candidate_list[0]
else:
return {}


def get_all_mapping_names(gw_session: GatewaySession) -> list:
Expand Down

0 comments on commit 28d00a7

Please sign in to comment.