test: remove sync_legacy_series_to_db tests

- Removed TestSyncSeriesFromDataFiles class from test_anime_service.py
- Updated TestSyncAnimeFolders tests to expect sync_count=0
- Removed TestSyncSeriesToDatabase class from test_data_file_db_sync.py
This commit is contained in:
2026-06-10 18:26:09 +02:00
parent 08f7f7453c
commit e76cd3a708
3 changed files with 6 additions and 229 deletions

View File

@@ -161,14 +161,11 @@ class TestSyncAnimeFolders:
async def test_sync_anime_folders_without_progress(self):
"""Test syncing anime folders without progress service."""
with patch('src.server.services.initialization_service.settings') as mock_settings, \
patch('src.server.services.initialization_service.os.path.isdir', return_value=True), \
patch('src.server.services.initialization_service.sync_legacy_series_to_db',
new_callable=AsyncMock, return_value=42) as mock_sync:
patch('src.server.services.initialization_service.os.path.isdir', return_value=True):
mock_settings.anime_directory = "/path/to/anime"
result = await _sync_anime_folders()
assert result == 42
mock_sync.assert_called_once()
assert result == 0
@pytest.mark.asyncio
async def test_sync_anime_folders_with_progress(self):
@@ -176,13 +173,11 @@ class TestSyncAnimeFolders:
mock_progress = AsyncMock()
with patch('src.server.services.initialization_service.settings') as mock_settings, \
patch('src.server.services.initialization_service.os.path.isdir', return_value=True), \
patch('src.server.services.initialization_service.sync_legacy_series_to_db',
new_callable=AsyncMock, return_value=10) as mock_sync:
patch('src.server.services.initialization_service.os.path.isdir', return_value=True):
mock_settings.anime_directory = "/path/to/anime"
result = await _sync_anime_folders(progress_service=mock_progress)
assert result == 10
assert result == 0
# Verify progress updates were called
assert mock_progress.update_progress.call_count == 2
mock_progress.update_progress.assert_any_call(
@@ -194,7 +189,7 @@ class TestSyncAnimeFolders:
mock_progress.update_progress.assert_any_call(
progress_id="series_sync",
current=75,
message="Synced 10 series from data files",
message="Series loaded directly from database",
metadata={"step_id": "series_sync"}
)