"""Tests for exercise browser routes.""" from fastapi.testclient import TestClient class TestExerciseBrowser: """Tests for GET /exercises.""" def test_exercise_browser_requires_profile(self, client: TestClient) -> None: """GET /exercises should redirect to / without profile cookie.""" response = client.get("/exercises", follow_redirects=False) assert response.status_code == 302 assert response.headers["location"] == "/" class TestExerciseSearch: """Tests for HTMX exercise search.""" def test_exercise_search_requires_profile(self, client: TestClient) -> None: """GET /exercises/search should redirect to / without profile cookie.""" response = client.get( "/exercises/search?workout_day=Push", follow_redirects=False, ) assert response.status_code == 302 assert response.headers["location"] == "/"