implement basic testing fixtures and linting #19
							
								
								
									
										4
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| @@ -26,11 +26,11 @@ | |||||||
|             "name": "Backend - tester", |             "name": "Backend - tester", | ||||||
|             "type": "debugpy", |             "type": "debugpy", | ||||||
|             "request": "launch", |             "request": "launch", | ||||||
|             "program": "src/tester.py", |             "program": "backend/src/tester.py", | ||||||
|             "env": { |             "env": { | ||||||
|                 "DEBUG": "true" |                 "DEBUG": "true" | ||||||
|             }, |             }, | ||||||
|             "cwd": "${workspaceFolder}/backend" |             "cwd": "${workspaceFolder}" | ||||||
|         }, |         }, | ||||||
|         // frontend - flutter app |         // frontend - flutter app | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ pylint = "*" | |||||||
| pytest = "*" | pytest = "*" | ||||||
| tomli = "*" | tomli = "*" | ||||||
| exceptiongroup = "*" | exceptiongroup = "*" | ||||||
|  | httpx = "*" | ||||||
|  |  | ||||||
| [packages] | [packages] | ||||||
| numpy = "*" | numpy = "*" | ||||||
|   | |||||||
							
								
								
									
										1461
									
								
								backend/Pipfile.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1461
									
								
								backend/Pipfile.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,12 +1,12 @@ | |||||||
| import logging | import logging | ||||||
| import yaml | import yaml | ||||||
|  |  | ||||||
| from utils.landmarks_manager import LandmarkManager | from .utils.landmarks_manager import LandmarkManager | ||||||
| from utils.optimizer import Optimizer | from .utils.optimizer import Optimizer | ||||||
| from utils.refiner import Refiner | from .utils.refiner import Refiner | ||||||
| from structs.landmark import Landmark | from .structs.landmark import Landmark | ||||||
| from structs.linked_landmarks import LinkedLandmarks | from .structs.linked_landmarks import LinkedLandmarks | ||||||
| from structs.preferences import Preferences, Preference | from .structs.preferences import Preferences, Preference | ||||||
|  |  | ||||||
|  |  | ||||||
| logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||||
|   | |||||||
| @@ -39,12 +39,14 @@ def load_trip_landmarks(client, first_uuid): | |||||||
|     landmarks = [] |     landmarks = [] | ||||||
|     next_uuid = first_uuid |     next_uuid = first_uuid | ||||||
|  |  | ||||||
|  |     i = 0 | ||||||
|  |  | ||||||
|     while next_uuid is not None: |     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 |         landmarks.append(Landmark(**landmark_data))  # Create Landmark objects | ||||||
|  |  | ||||||
|         # Prepare for the next iteration |         # 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 |     # Create and return a LinkedLandmarks object with the collected landmarks | ||||||
|     return landmarks |     return landmarks | ||||||
| @@ -82,6 +84,7 @@ def test_1(client): | |||||||
|     landmarks = load_trip_landmarks(client, result['first_landmark_uuid']) |     landmarks = load_trip_landmarks(client, result['first_landmark_uuid']) | ||||||
|  |  | ||||||
|     assert isinstance(landmarks, list) |     assert isinstance(landmarks, list) | ||||||
|  |     assert len(landmarks) > 2 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user