mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
refactor: remove unnecessary get_session_factory usage
- Updated rooms_list endpoint to use injected session dependency - Removed get_session_factory import from views/rooms.py - Updated test_pipeline_main_file.py to use mock session instead of get_session_factory - Pipeline files keep their get_session_factory usage as they manage long-running operations
This commit is contained in:
@@ -624,10 +624,11 @@ async def test_pipeline_file_process_no_transcript():
|
||||
|
||||
# Should raise an exception for missing transcript when get_transcript is called
|
||||
with pytest.raises(Exception, match="Transcript not found"):
|
||||
from reflector.db import get_session_factory
|
||||
# Use a mock session - the controller is mocked to return None anyway
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
async with get_session_factory()() as session:
|
||||
await pipeline.get_transcript(session)
|
||||
mock_session = MagicMock()
|
||||
await pipeline.get_transcript(mock_session)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user