Skip to content

Commit

Permalink
Merge pull request #595 from CartoDB/development
Browse files Browse the repository at this point in the history
Fix origin/destination in isolines
  • Loading branch information
antoniocarlon authored Mar 27, 2020
2 parents 1a2d8e8 + 4d231c1 commit f68f997
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __parse_isolines_response(self, response):

def __parse_source_param(self, source, options):
key = 'start'
if 'is_destination' in options and options['is_destination']:
if 'is_destination' in options and options['is_destination'].lower() == 'true':
key = 'destination'

return {key: source}
Expand Down
2 changes: 1 addition & 1 deletion server/lib/python/cartodb_services/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
setup(
name='cartodb_services',

version='0.23.1',
version='0.23.2',

description='CartoDB Services API Python Library',

Expand Down
10 changes: 10 additions & 0 deletions server/lib/python/cartodb_services/test/test_heremapsrouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ def test_mode_parameters_works_properly(self, req_mock):
'fastest;car;traffic:false;motorway:-1')

def test_source_parameters_works_properly(self, req_mock):
req_mock.register_uri('GET', requests_mock.ANY,
text=self.GOOD_RESPONSE)
response = self.routing.calculate_isochrone('geo!33.0,1.0', 'car',
['1000', '2000'],
['is_destination=false'])
parsed_url = urlparse(req_mock.request_history[0].url)
url_params = parse_qs(parsed_url.query)
self.assertEqual(url_params['start'][0], 'geo!33.0,1.0')

def test_destination_parameters_works_properly(self, req_mock):
req_mock.register_uri('GET', requests_mock.ANY,
text=self.GOOD_RESPONSE)
response = self.routing.calculate_isochrone('geo!33.0,1.0', 'car',
Expand Down

0 comments on commit f68f997

Please sign in to comment.