refactor: simplify NFO handling, remove legacy services
- Drop nfo_factory, nfo_repair_service, nfo_service, series_manager_service - Delete key_resolution_service, consolidate into folder_rename_service - Remove bulk of NFO-related tests (coverage via integration tests) - Streamline SeriesApp, background_loader, initialization services - Add folder_rename_service to scheduler Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -55,43 +55,6 @@ class TestConcurrentDownloads:
|
||||
assert DownloadStatus.FAILED is not None
|
||||
|
||||
|
||||
class TestParallelNfoGeneration:
|
||||
"""Parallel NFO creation for multiple series."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("src.core.services.series_manager_service.SerieList")
|
||||
async def test_multiple_series_process_sequentially(self, mock_sl):
|
||||
"""process_nfo_for_series called for each serie in order."""
|
||||
from src.core.services.series_manager_service import SeriesManagerService
|
||||
|
||||
manager = SeriesManagerService(
|
||||
anime_directory="/anime",
|
||||
tmdb_api_key=None,
|
||||
)
|
||||
# Without nfo_service, should be no-op
|
||||
await manager.process_nfo_for_series(
|
||||
serie_folder="test-folder",
|
||||
serie_name="Test Anime",
|
||||
serie_key="test-key",
|
||||
)
|
||||
# No exception raised
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_concurrent_factory_calls_return_same_singleton(self):
|
||||
"""get_nfo_factory returns the same instance across concurrent calls."""
|
||||
from src.core.services.nfo_factory import get_nfo_factory
|
||||
|
||||
results = []
|
||||
|
||||
async def get_factory():
|
||||
results.append(get_nfo_factory())
|
||||
|
||||
tasks = [get_factory() for _ in range(5)]
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
assert all(r is results[0] for r in results)
|
||||
|
||||
|
||||
class TestCacheConsistency:
|
||||
"""Cache consistency under concurrent access."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user