From b0f9d31ee2f0a3f16ea6d55118d88ac12731696b Mon Sep 17 00:00:00 2001 From: kscheidecker Date: Sun, 13 Jul 2025 17:43:24 +0200 Subject: [PATCH] Implement backend API for landmarks, trip optimization, and toilet locations - Added landmarks_router.py to handle landmark retrieval based on user preferences and location. - Implemented optimization_router.py for trip optimization, including handling preferences and landmarks. - Created toilets_router.py to fetch toilet locations within a specified radius from a given location. - Enhanced error handling and logging across all new endpoints. - Generated a comprehensive report.html for test results and environment details. --- backend/report.html | 10 +- backend/src/landmarks/landmarks_manager.py | 12 +- ...andmarks_routes.py => landmarks_router.py} | 26 +- backend/src/main.py | 127 +- ...ation_routes.py => optimization_router.py} | 65 +- .../src/parameters/landmark_parameters.yaml | 1 - .../src/parameters/optimizer_parameters.yaml | 3 +- backend/src/structs/preferences.py | 9 +- backend/src/tests/test_invalid_input.py | 30 +- backend/src/tests/test_nearby.py | 22 +- backend/src/tests/test_toilets.py | 12 +- backend/src/tests/test_trip_generation.py | 6 +- .../{toilets_route.py => toilets_router.py} | 14 +- backend/src/utils/take_most_important.py | 24 - report.html | 1091 +++++++++++++++++ 15 files changed, 1235 insertions(+), 217 deletions(-) rename backend/src/landmarks/{landmarks_routes.py => landmarks_router.py} (81%) rename backend/src/optimization/{optimization_routes.py => optimization_router.py} (78%) rename backend/src/toilets/{toilets_route.py => toilets_router.py} (83%) delete mode 100644 backend/src/utils/take_most_important.py create mode 100644 report.html diff --git a/backend/report.html b/backend/report.html index f6bc656..8a8a354 100644 --- a/backend/report.html +++ b/backend/report.html @@ -328,7 +328,7 @@ div.media {

Backend Testing Report

-

Report generated on 02-Jul-2025 at 21:46:07 by pytest-html +

Report generated on 13-Jul-2025 at 17:36:30 by pytest-html v4.1.1

Environment

@@ -382,7 +382,7 @@ div.media {

Summary

-

8 tests took 00:02:10.

+

8 tests took 00:10:27.

(Un)check the boxes to filter the results.