diff --git a/server/lib/python/cartodb_services/cartodb_services/here/routing.py b/server/lib/python/cartodb_services/cartodb_services/here/routing.py index ab36adf..fddc3d7 100644 --- a/server/lib/python/cartodb_services/cartodb_services/here/routing.py +++ b/server/lib/python/cartodb_services/cartodb_services/here/routing.py @@ -115,7 +115,7 @@ class HereMapsRoutingIsoline(Traceable): 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} diff --git a/server/lib/python/cartodb_services/setup.py b/server/lib/python/cartodb_services/setup.py index 3c644e5..30e60e2 100644 --- a/server/lib/python/cartodb_services/setup.py +++ b/server/lib/python/cartodb_services/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages setup( name='cartodb_services', - version='0.23.1', + version='0.23.2', description='CartoDB Services API Python Library', diff --git a/server/lib/python/cartodb_services/test/test_heremapsrouting.py b/server/lib/python/cartodb_services/test/test_heremapsrouting.py index 6226572..96c114c 100644 --- a/server/lib/python/cartodb_services/test/test_heremapsrouting.py +++ b/server/lib/python/cartodb_services/test/test_heremapsrouting.py @@ -204,6 +204,16 @@ class HereMapsRoutingIsolineTestCase(unittest.TestCase): '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',