Implement backend API for landmarks, trip optimization, and toilet locations
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m49s
Run linting on the backend code / Build (pull_request) Successful in 30s
Run testing on the backend code / Build (pull_request) Failing after 45s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 32s

- 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.
This commit is contained in:
2025-07-13 17:43:24 +02:00
parent 54bc9028ad
commit b0f9d31ee2
15 changed files with 1235 additions and 217 deletions

View File

@@ -18,7 +18,7 @@ def client():
[
({}, None, 422), # Invalid case: no location at all.
([443], None, 422), # Invalid cases: invalid location.
([443, 433], None, 422), # Invalid cases: invalid location.
([443, 433], None, 422), # Invalid cases: invalid location.
]
)
def test_invalid_input(client, location, radius, status_code): # pylint: disable=redefined-outer-name
@@ -30,12 +30,13 @@ def test_invalid_input(client, location, radius, status_code): # pylint: disa
request:
"""
response = client.post(
"/toilets/new",
"/get/toilets",
params={
"location": location,
"radius": radius
}
)
print(response.json())
# checks :
assert response.status_code == status_code
@@ -58,11 +59,12 @@ def test_no_toilets(client, location, status_code): # pylint: disable=redefin
request:
"""
response = client.post(
"/toilets/new",
"/get/toilets",
params={
"location": location
}
)
print(response.json())
toilets_list = [Toilets.model_validate(toilet) for toilet in response.json()]
# checks :
@@ -87,12 +89,14 @@ def test_toilets(client, location, status_code): # pylint: disable=redefined-
request:
"""
response = client.post(
"/toilets/new",
"/get/toilets",
params={
"location": location,
"radius" : 600
}
)
print(response.json())
toilets_list = [Toilets.model_validate(toilet) for toilet in response.json()]
# checks :