feat: implement Fitbit OAuth, Garmin MFA, and optimize segment discovery

- Add Fitbit authentication flow (save credentials, OAuth callback handling)
- Implement Garmin MFA support with successful session/cookie handling
- Optimize segment discovery with new sampling and activity query services
- Refactor database session management in discovery API for better testability
- Enhance activity data parsing for charts and analysis
- Update tests to use testcontainers and proper dependency injection
- Clean up repository by ignoring and removing tracked transient files (.pyc, .db)
This commit is contained in:
2026-01-16 15:35:26 -08:00
parent 45dbc32295
commit d1cfd0fd8e
217 changed files with 1795 additions and 922 deletions

View File

@@ -3,9 +3,8 @@ from main import app
from unittest.mock import MagicMock, patch
client = TestClient(app)
def test_discovery_endpoint():
def test_discovery_endpoint(client):
# Mock the service to avoid DB calls
with patch('src.api.discovery.SegmentDiscoveryService') as MockService:
instance = MockService.return_value
@@ -25,7 +24,7 @@ def test_discovery_endpoint():
assert isinstance(data["debug_paths"], list)
def test_discovery_page_render():
def test_discovery_page_render(client):
response = client.get("/discovery")
assert response.status_code == 200
assert "Segment Discovery" in response.text