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:
2025-09-23 18:11:15 -06:00
parent a07c621bcd
commit ad2accb574
2 changed files with 10 additions and 10 deletions

View File

@@ -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