test: rename db_db_session to db_session across test files

- Standardized test fixture naming from db_db_session to db_session
- Updated all test files to use consistent parameter naming
- All tests now passing with the new naming convention
This commit is contained in:
2025-09-23 12:20:38 -06:00
parent 27b3b9cdee
commit 1c9e8b9cde
9 changed files with 261 additions and 141 deletions

View File

@@ -134,10 +134,10 @@ async def test_ics_fetch_service_extract_room_events():
@pytest.mark.asyncio
async def test_ics_sync_service_sync_room_calendar(db_db_session):
async def test_ics_sync_service_sync_room_calendar(db_session):
# Create room
room = await rooms_controller.add(
session,
db_session,
name="sync-test",
user_id="test-user",
zulip_auto_post=False,
@@ -201,16 +201,16 @@ async def test_ics_sync_service_sync_room_calendar(db_db_session):
assert result["events_deleted"] == 0
# Verify event was created
events = await calendar_events_controller.get_by_room(session, room.id)
events = await calendar_events_controller.get_by_room(db_session, room.id)
assert len(events) == 1
assert events[0].ics_uid == "sync-event-1"
assert events[0].title == "Sync Test Meeting"
# Second sync with same content (should be unchanged)
# Refresh room to get updated etag and force sync by setting old sync time
room = await rooms_controller.get_by_id(session, room.id)
room = await rooms_controller.get_by_id(db_session, room.id)
await rooms_controller.update(
session,
db_session,
room,
{"ics_last_sync": datetime.now(timezone.utc) - timedelta(minutes=10)},
)
@@ -225,7 +225,7 @@ async def test_ics_sync_service_sync_room_calendar(db_db_session):
mock_fetch.return_value = ics_content
# Force sync by clearing etag
await rooms_controller.update(session, room, {"ics_last_etag": None})
await rooms_controller.update(db_session, room, {"ics_last_etag": None})
result = await sync_service.sync_room_calendar(room)
assert result["status"] == "success"
@@ -233,7 +233,7 @@ async def test_ics_sync_service_sync_room_calendar(db_db_session):
assert result["events_updated"] == 1
# Verify event was updated
events = await calendar_events_controller.get_by_room(session, room.id)
events = await calendar_events_controller.get_by_room(db_session, room.id)
assert len(events) == 1
assert events[0].title == "Updated Meeting Title"
@@ -280,10 +280,10 @@ async def test_ics_sync_service_skip_disabled():
@pytest.mark.asyncio
async def test_ics_sync_service_error_handling(db_db_session):
async def test_ics_sync_service_error_handling(db_session):
# Create room
room = await rooms_controller.add(
session,
db_session,
name="error-test",
user_id="test-user",
zulip_auto_post=False,