Skip to content

Commit

Permalink
fix flatten list param
Browse files Browse the repository at this point in the history
Update _by_hotels.py

Update test_namespaces.py
  • Loading branch information
siddydutta committed Sep 14, 2023
1 parent 98dfe7f commit 72f1294
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions amadeus/reference_data/locations/hotels/_by_hotels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ def get(self, **params):
:rtype: amadeus.Response
:raises amadeus.ResponseError: if the request could not be completed
'''
for key, value in params.items():
if isinstance(value, list):
params[key] = ','.join(value)
return self.client.get(
'/v1/reference-data/locations/hotels/by-hotels', **params)
5 changes: 3 additions & 2 deletions specs/namespaces/test_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,10 @@ def test_analytics_itinerary_price_metrics_get(client_setup):


def test_reference_data_locations_hotels_by_hotels_get(client_setup):
client_setup.reference_data.locations.hotels.by_hotels.get(a='b')
client_setup.reference_data.locations.hotels.by_hotels.get(a='b',
c=['d', 'e'])
client_setup.get.assert_called_with(
'/v1/reference-data/locations/hotels/by-hotels', a='b'
'/v1/reference-data/locations/hotels/by-hotels', a='b', c='d,e'
)


Expand Down

0 comments on commit 72f1294

Please sign in to comment.