@@ -955,12 +955,19 @@ def get_response_andyamo_represents_start_true_test():
955
955
destination = make_pt_object (type_pb2 .ADDRESS , lon = - 1.6740057 , lat = 48.097592 , uri = 'AndyamoEnd' )
956
956
fallback_extremity = PeriodExtremity (str_to_time_stamp ('20220503T060000' ), True )
957
957
958
- proto_resp = andyamo ._get_response (resp_json , origin , destination , fallback_extremity )
958
+ proto_resp = andyamo ._get_response (
959
+ json_response = resp_json ,
960
+ pt_object_origin = origin ,
961
+ pt_object_destination = destination ,
962
+ fallback_extremity = fallback_extremity ,
963
+ request = {'datetime' : str_to_time_stamp ('20220503T060000' )},
964
+ )
959
965
960
966
assert len (proto_resp .journeys ) == 1
961
967
assert proto_resp .journeys [0 ].durations .total == 2245
962
968
assert proto_resp .journeys [0 ].durations .walking == 2245
963
969
assert proto_resp .journeys [0 ].distances .walking == 2807
970
+ assert proto_resp .journeys [0 ].requested_date_time == str_to_time_stamp ('20220503T060000' )
964
971
965
972
assert len (proto_resp .journeys [0 ].sections ) == 1
966
973
assert proto_resp .journeys [0 ].sections [0 ].type == response_pb2 .STREET_NETWORK
@@ -981,7 +988,13 @@ def get_response_andyamo_represents_start_false_test():
981
988
destination = make_pt_object (type_pb2 .ADDRESS , lon = - 1.6740057 , lat = 48.097592 , uri = 'AndyamoEnd' )
982
989
fallback_extremity = PeriodExtremity (str_to_time_stamp ('20220503T060000' ), False )
983
990
984
- proto_resp = andyamo ._get_response (resp_json , origin , destination , fallback_extremity )
991
+ proto_resp = andyamo ._get_response (
992
+ json_response = resp_json ,
993
+ pt_object_origin = origin ,
994
+ pt_object_destination = destination ,
995
+ fallback_extremity = fallback_extremity ,
996
+ request = {'datetime' : str_to_time_stamp ('20220503T055500' )},
997
+ )
985
998
986
999
assert len (proto_resp .journeys ) == 1
987
1000
assert proto_resp .journeys [0 ].durations .total == 2245 # Adjusted to match the response
@@ -990,6 +1003,7 @@ def get_response_andyamo_represents_start_false_test():
990
1003
assert (
991
1004
abs (proto_resp .journeys [0 ].distances .walking - 2807.08 ) < 0.1
992
1005
) # Allow a small difference due to rounding
1006
+ assert proto_resp .journeys [0 ].requested_date_time == str_to_time_stamp ('20220503T055500' )
993
1007
994
1008
995
1009
def test_get_response_int_cast_success (): # Préparation des données de test
@@ -1008,11 +1022,18 @@ def test_get_response_int_cast_success(): # Préparation des données de test
1008
1022
andyamo = Andyamo (instance = instance , service_url = fake_service_url , service_backup = service_backup , zone = '' )
1009
1023
1010
1024
# Appel de la méthode _get_response
1011
- resp = andyamo ._get_response (json_response , pt_object_origin , pt_object_destination , fallback_extremity )
1025
+ resp = andyamo ._get_response (
1026
+ json_response = json_response ,
1027
+ pt_object_origin = pt_object_origin ,
1028
+ pt_object_destination = pt_object_destination ,
1029
+ fallback_extremity = fallback_extremity ,
1030
+ request = {'datetime' : str_to_time_stamp ('20220503T123000' )},
1031
+ )
1012
1032
1013
1033
assert resp .journeys [0 ].sections [0 ].street_network .path_items [0 ].direction == 0
1014
1034
assert resp .journeys [0 ].sections [0 ].street_network .path_items [2 ].direction == - 90
1015
1035
assert resp .journeys [0 ].sections [0 ].street_network .path_items [4 ].direction == 90
1036
+ assert resp .journeys [0 ].requested_date_time == str_to_time_stamp ('20220503T123000' )
1016
1037
1017
1038
1018
1039
def create_pt_object (lon , lat , pt_object_type = type_pb2 .POI ):
0 commit comments