from fastapi.testclient import TestClient import pytest from ..main import app @pytest.fixture() def client(): return TestClient(app) def test_new_trip_invalid_prefs(client): response = client.post( "/trip/new", json={ "preferences": {}, "start": [48.8566, 2.3522] } ) assert response.status_code == 422 def test_new_trip_single_prefs(client): response = client.post( "/trip/new", json={ "preferences": {"sightseeing": {"type": "sightseeing", "score": 1}, "nature": {"type": "nature", "score": 1}, "shopping": {"type": "shopping", "score": 1}, "max_time_minute": 360, "detour_tolerance_minute": 0}, "start": [48.8566, 2.3522] } ) assert response.status_code == 200 def test_new_trip_matches_prefs(client): # todo pass