Skip to content

Commit f804eda

Browse files
authored
Merge pull request #4353 from hove-io/fix_traveler_profile
Fix: Add traveler_profile absent attributes
2 parents 2b944cf + f7f0c27 commit f804eda

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

source/tyr/tests/integration/instance_test.py

+6
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ def test_update_traveler_profile(create_instance, traveler_profile_params):
410410

411411
api_post('/v0/instances/fr/traveler_profiles/standard')
412412

413+
# Modify certain attributes absent in traveler_profile_params
414+
traveler_profile_params["max_car_no_park_direct_path_duration"] = 3 * 60 * 60
415+
traveler_profile_params["max_taxi_direct_path_duration"] = 2 * 60 * 60
416+
413417
resp = api_put(
414418
'/v0/instances/fr/traveler_profiles/standard',
415419
data=json.dumps(traveler_profile_params),
@@ -432,6 +436,8 @@ def test_update_traveler_profile(create_instance, traveler_profile_params):
432436
assert resp[0]['walking_step_penalty'] == 40.0
433437
assert resp[0]['max_walking_direct_path_duration'] == 4 * 60 * 60
434438
assert resp[0]['max_bike_direct_path_duration'] == 4 * 60 * 60
439+
assert resp[0]['max_car_no_park_direct_path_duration'] == 3 * 60 * 60
440+
assert resp[0]['max_taxi_direct_path_duration'] == 2 * 60 * 60
435441

436442

437443
def test_delete_traveler_profile(create_instance):

source/tyr/tyr/resources.py

+16
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,22 @@ def __init__(self):
22212221
location=('json', 'values'),
22222222
)
22232223

2224+
parser.add_argument(
2225+
'max_car_no_park_direct_path_duration',
2226+
type=PositiveFloat(),
2227+
required=False,
2228+
help='in second',
2229+
location=('json', 'values'),
2230+
)
2231+
2232+
parser.add_argument(
2233+
'max_taxi_direct_path_duration',
2234+
type=PositiveFloat(),
2235+
required=False,
2236+
help='in second',
2237+
location=('json', 'values'),
2238+
)
2239+
22242240
self.args = parser.parse_args()
22252241

22262242
def check_resources(f):

0 commit comments

Comments
 (0)