From 72018b063f13028bc6b50a8c603d0937427bce2e Mon Sep 17 00:00:00 2001 From: krishna Date: Tue, 17 Dec 2024 15:00:56 +0100 Subject: [PATCH] Test added to verify parameters in status --- source/jormungandr/tests/end_point_tests.py | 43 +++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/source/jormungandr/tests/end_point_tests.py b/source/jormungandr/tests/end_point_tests.py index bb2c83d38c..f3c2030571 100644 --- a/source/jormungandr/tests/end_point_tests.py +++ b/source/jormungandr/tests/end_point_tests.py @@ -258,3 +258,46 @@ def test_coord_without_region_shouldnt_call_places_nearby(self): r1 = self.tester.get('v1/coverage/main_routing_test/coord/0.001077974378345651;0.0005839027882705609') r2 = self.tester.get('v1/coord/0.001077974378345651;0.0005839027882705609') assert r1.get_json()['address'] == r2.get_json()['address'] + + def test_parameters_in_one_status(self): + json_response = self.query("/v1/coverage/main_routing_test/status") + is_valid_region_status(get_not_null(json_response, "status")) + self.check_context(json_response) + + # Verify that parameters exist in parameters for walking as wall as bike and some others + parameters = json_response['status']['parameters'] + assert len(parameters) == 90 + assert parameters['walking_walkway_factor'] == 1.0 + assert parameters['walking_sidewalk_factor'] == 1.0 + assert parameters['walking_alley_factor'] == 2.0 + assert parameters['walking_driveway_factor'] == 5.0 + assert parameters['walking_step_penalty'] == 30.0 + assert parameters['walking_use_ferry'] == 0.5 + assert parameters['walking_use_living_streets'] == 0.6 + assert parameters['walking_use_tracks'] == 0.5 + assert parameters['walking_use_hills'] == 0.5 + assert parameters['walking_service_factor'] == 1 + assert parameters['walking_max_hiking_difficulty'] == 1 + assert parameters['walking_shortest'] is False + assert parameters['walking_ignore_oneways'] is True + assert parameters['walking_destination_only_penalty'] == 120 + + assert parameters['bike_use_roads'] == 0.5 + assert parameters['bike_use_hills'] == 0.5 + assert parameters['bike_use_ferry'] == 0.5 + assert parameters['bike_avoid_bad_surfaces'] == 0.25 + assert parameters['bike_shortest'] is False + assert parameters['bicycle_type'] == 'Hybrid' + assert parameters['bike_use_living_streets'] == 0.5 + assert parameters['bike_maneuver_penalty'] == 5 + assert parameters['bike_service_penalty'] == 0 + assert parameters['bike_service_factor'] == 1 + assert parameters['bike_country_crossing_cost'] == 600 + assert parameters['bike_country_crossing_penalty'] == 0 + assert parameters['bike_destination_only_penalty'] == 120 + + assert parameters['max_walking_direct_path_duration'] == 86400 # 24 * 60 * 60 + assert parameters['max_bike_direct_path_duration'] == 86400 + assert parameters['max_bss_direct_path_duration'] == 86400 + assert parameters['max_car_direct_path_duration'] == 86400 + assert parameters['max_ridesharing_direct_path_duration'] == 86400