From a4f930c434a171ad5e68fc5931d5aa65de1b2f66 Mon Sep 17 00:00:00 2001 From: Pondonda Date: Mon, 13 Jan 2025 13:37:32 +0100 Subject: [PATCH] add section from to none tests --- .../tests/routing_tests_experimental.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/source/jormungandr/tests/routing_tests_experimental.py b/source/jormungandr/tests/routing_tests_experimental.py index 85e9a4736f..af58307d62 100644 --- a/source/jormungandr/tests/routing_tests_experimental.py +++ b/source/jormungandr/tests/routing_tests_experimental.py @@ -1706,3 +1706,25 @@ def test_bike_with_parking_penalty_multiple_first_section_mode_park_mode_park_an assert journey['sections'][0]['mode'] in ['bike', 'walking'] assert journey['sections'][1]['type'] != 'park' + + def test_bike_park_section_from_to_none(self): + query = ( + sub_query + + "&datetime=20120614T075000" + + "&first_section_mode[]=bike" + + "&bike_speed=0.05" + + "&park_mode=on_street" + + "&_access_points=true" + ) + + response = self.query_region(query) + check_best(response) + + journeys = get_not_null(response, 'journeys') + pt_journeys = [j for j in journeys if 'bike' in j['tags'] and 'non_pt_bike' not in j['tags']] + assert len(pt_journeys) > 0 + print("Blablab", pt_journeys[0]["sections"][1]) + for journey in pt_journeys: + assert journey['sections'][1]['type'] == 'park' + assert 'from' not in journey['sections'][1] + assert 'to' not in journey['sections'][1]