Skip to content

Commit

Permalink
Merge pull request #203 from siddydutta/fix-list-query-param
Browse files Browse the repository at this point in the history
Fix: List Type Query Parameter for Hotel List API
  • Loading branch information
tsolakoua authored Sep 20, 2023
2 parents 98dfe7f + 72f1294 commit 9e35e61
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 9e35e61

Please sign in to comment.