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:
@@ -2,9 +2,8 @@ from fastapi.testclient import TestClient
|
||||
from main import app
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
def test_single_discovery_endpoint():
|
||||
def test_single_discovery_endpoint(client):
|
||||
# Mock the service
|
||||
with patch('src.api.discovery.SegmentDiscoveryService') as MockService:
|
||||
instance = MockService.return_value
|
||||
@@ -29,7 +28,7 @@ def test_single_discovery_endpoint():
|
||||
assert data["candidates"][0]["frequency"] == 1
|
||||
assert data["candidates"][0]["distance"] == 1000.0
|
||||
|
||||
def test_single_discovery_not_found():
|
||||
def test_single_discovery_not_found(client):
|
||||
with patch('src.api.discovery.SegmentDiscoveryService') as MockService:
|
||||
instance = MockService.return_value
|
||||
instance.analyze_single_activity.return_value = []
|
||||
|
||||
Reference in New Issue
Block a user