Skip to content

Commit b11e002

Browse files
committed
add test and docs
1 parent 7fdf1b8 commit b11e002

4 files changed

Lines changed: 24 additions & 2 deletions

File tree

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ List of supported endpoints
282282
# Returns a single Point of Interest from a given id
283283
amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get()
284284
285+
# Location Score
286+
amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873)
287+
285288
# Safe Place
286289
# How safe is Barcelona? (based a geo location and a radius)
287290
amadeus.safety.safety_rated_locations.get(latitude=41.397158, longitude=2.160873)

amadeus/namespaces/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from amadeus.namespaces._safety import Safety
99
from amadeus.namespaces._schedule import Schedule
1010
from amadeus.namespaces._analytics import Analytics
11+
from amadeus.namespaces._location import Location
1112

1213

1314
class Core(object):
@@ -22,3 +23,4 @@ def __init__(self):
2223
self.safety = Safety(self)
2324
self.schedule = Schedule(self)
2425
self.analytics = Analytics(self)
26+
self.location = Location(self)

docs/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,17 @@ Safety/SafetyRatedLocations
208208
Schedule/Flights
209209
================
210210

211-
.. autoclass:: amadeus.schedule.flights
211+
.. autoclass:: amadeus.schedule.Flights
212212
:members: get
213213

214214
Analytics/ItineraryPriceMetrics
215215
================
216216

217-
.. autoclass:: amadeus.analytics.itinerary_price_metrics
217+
.. autoclass:: amadeus.analytics.ItineraryPriceMetrics
218+
:members: get
219+
220+
Location/Analytics
221+
================
222+
223+
.. autoclass:: amadeus.location.analytics.CategoryRatedAreas
218224
:members: get

specs/namespaces/namespaces_spec.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
expect(client.analytics).not_to(be_none)
8585
expect(client.analytics.itinerary_price_metrics).not_to(be_none)
8686

87+
expect(client.location).not_to(be_none)
88+
expect(client.location.analytics.category_rated_areas).not_to(be_none)
89+
8790
with it('should define all expected .get methods'):
8891
client = self.client
8992
expect(client.reference_data.urls.checkin_links.get).not_to(be_none)
@@ -139,6 +142,8 @@
139142

140143
expect(client.analytics.itinerary_price_metrics.get).not_to(be_none)
141144

145+
expect(client.location.analytics.category_rated_areas.get).not_to(be_none)
146+
142147
with it('should define all expected .delete methods'):
143148
client = self.client
144149
expect(client.booking.flight_order('123').delete).not_to(be_none)
@@ -203,6 +208,12 @@
203208
'/v1/reference-data/locations/pois/XXX', a='b'
204209
))
205210

211+
with it('.location.analytics.category_rated_areas.get'):
212+
self.client.location.analytics.category_rated_areas.get(a='b')
213+
expect(self.client.get).to(have_been_called_with(
214+
'/v1/location/analytics/category-rated-areas', a='b'
215+
))
216+
206217
with it('.reference_data.recommended_locations.get'):
207218
self.client.reference_data.recommended_locations.get(a='b')
208219
expect(self.client.get).to(have_been_called_with(

0 commit comments

Comments
 (0)