Merge modifications for more separate backend functions #69
| @@ -94,34 +94,3 @@ def log_trip_details(request, landmarks: list[Landmark], duration: int, target_d | ||||
|     request.node.trip_details = trip_string | ||||
|     request.node.trip_duration = str(duration)              # result['total_time'] | ||||
|     request.node.target_duration = str(target_duration) | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| def trip_params( | ||||
|     sightseeing: int, | ||||
|     shopping: int, | ||||
|     nature: int, | ||||
|     max_time_minute: int, | ||||
|     start_coords: tuple[float, float] = None, | ||||
|     end_coords: tuple[float, float] = None, | ||||
| ): | ||||
|     def decorator(test_func): | ||||
|         @wraps(test_func) | ||||
|         def wrapper(client, request): | ||||
|             prefs = Preferences( | ||||
|                 sightseeing=Preference(type='sightseeing', score=sightseeing), | ||||
|                 shopping=Preference(type='shopping', score=shopping), | ||||
|                 nature=Preference(type='nature', score=nature), | ||||
|                 max_time_minute=max_time_minute, | ||||
|                 detour_tolerance_minute=0, | ||||
|             ) | ||||
|  | ||||
|             start = start_coords | ||||
|             end = end_coords | ||||
|  | ||||
|             # Inject into test function | ||||
|             return test_func(client, request, prefs, start, end) | ||||
|  | ||||
|         return wrapper | ||||
|     return decorator | ||||
		Reference in New Issue
	
	Block a user