new endpoint for toilets
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 2m35s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Failing after 28s
Run testing on the backend code / Build (pull_request) Failing after 1m24s

This commit is contained in:
2024-12-14 16:52:07 +01:00
parent 2033941953
commit edd8a8b2b9
10 changed files with 263 additions and 33 deletions

View File

@@ -1,6 +1,5 @@
"""Helper methods for testing."""
import logging
from typing import List
from fastapi import HTTPException
from pydantic import ValidationError
@@ -8,7 +7,7 @@ from ..structs.landmark import Landmark
from ..persistence import client as cache_client
def landmarks_to_osmid(landmarks: List[Landmark]) -> List[int] :
def landmarks_to_osmid(landmarks: list[Landmark]) -> list[int] :
"""
Convert the list of landmarks into a list containing their osm ids for quick landmark checking.
@@ -95,7 +94,7 @@ def fetch_landmark_cache(landmark_uuid: str):
def load_trip_landmarks(client, first_uuid: str, from_cache=None) -> List[Landmark]:
def load_trip_landmarks(client, first_uuid: str, from_cache=None) -> list[Landmark]:
"""
Load all landmarks for a trip using the response from the API.
@@ -120,7 +119,7 @@ def load_trip_landmarks(client, first_uuid: str, from_cache=None) -> List[Landma
return landmarks
def log_trip_details(request, landmarks: List[Landmark], duration: int, target_duration: int) :
def log_trip_details(request, landmarks: list[Landmark], duration: int, target_duration: int) :
"""
Allows to show the detailed trip in the html test report.