Compare commits

...

4 Commits

Author SHA1 Message Date
Antonio Carlón
f68f997eb7 Merge pull request #595 from CartoDB/development
Fix origin/destination in isolines
2020-03-27 09:13:29 +01:00
Antonio Carlón
4d231c1db0 Merge pull request #594 from CartoDB/Fix_here_is_destination_param
Fixing is_destination for HERE isolines
2020-03-27 08:11:37 +01:00
antoniocarlon
a1fdaacb4c Fixed spacing 2020-03-18 12:14:16 +01:00
antoniocarlon
09e24e13d3 Fixing is_destination for HERE isolines 2020-03-18 12:09:12 +01:00
3 changed files with 12 additions and 2 deletions

View File

@@ -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}

View File

@@ -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',

View File

@@ -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',