implement basic testing fixtures and linting #19

Closed
remoll wants to merge 7 commits from feature/backend-testing-and-linting into main
5 changed files with 815 additions and 670 deletions
Showing only changes of commit bdb040b756 - Show all commits

4
.vscode/launch.json vendored
View File

@ -26,11 +26,11 @@
"name": "Backend - tester",
"type": "debugpy",
"request": "launch",
"program": "src/tester.py",
"program": "backend/src/tester.py",
"env": {
"DEBUG": "true"
},
"cwd": "${workspaceFolder}/backend"
"cwd": "${workspaceFolder}"
},
// frontend - flutter app
{

View File

@ -8,6 +8,7 @@ pylint = "*"
pytest = "*"
tomli = "*"
exceptiongroup = "*"
httpx = "*"
[packages]
numpy = "*"

1461
backend/Pipfile.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
import logging
import yaml
from utils.landmarks_manager import LandmarkManager
from utils.optimizer import Optimizer
from utils.refiner import Refiner
from structs.landmark import Landmark
from structs.linked_landmarks import LinkedLandmarks
from structs.preferences import Preferences, Preference
from .utils.landmarks_manager import LandmarkManager
from .utils.optimizer import Optimizer
from .utils.refiner import Refiner
from .structs.landmark import Landmark
from .structs.linked_landmarks import LinkedLandmarks
from .structs.preferences import Preferences, Preference
logger = logging.getLogger(__name__)

View File

@ -39,12 +39,14 @@ def load_trip_landmarks(client, first_uuid):
landmarks = []
next_uuid = first_uuid
i = 0
while next_uuid is not None:
landmark_data = fetch_landmark(next_uuid)
landmark_data = fetch_landmark(client, next_uuid)
landmarks.append(Landmark(**landmark_data)) # Create Landmark objects
# Prepare for the next iteration
next_uuid = landmark_data.get(client, 'next_uuid') # Assuming landmark data contains 'next_uuid'
next_uuid = landmark_data.get('next_uuid') # Assuming landmark data contains 'next_uuid'
# Create and return a LinkedLandmarks object with the collected landmarks
return landmarks
@ -82,6 +84,7 @@ def test_1(client):
landmarks = load_trip_landmarks(client, result['first_landmark_uuid'])
assert isinstance(landmarks, list)
assert len(landmarks) > 2