Remove TestPerformNfoRepairScan tests
NFO service removed - these tests no longer needed.
This commit is contained in:
@@ -29,7 +29,6 @@ from src.server.services.initialization_service import (
|
|||||||
perform_media_scan_if_needed,
|
perform_media_scan_if_needed,
|
||||||
perform_nfo_scan_if_needed,
|
perform_nfo_scan_if_needed,
|
||||||
)
|
)
|
||||||
from src.server.services.scheduler.folder_scan_service import perform_nfo_repair_scan
|
|
||||||
|
|
||||||
|
|
||||||
class TestCheckScanStatus:
|
class TestCheckScanStatus:
|
||||||
@@ -739,55 +738,3 @@ class TestInitializationIntegration:
|
|||||||
result2 = await perform_initial_setup()
|
result2 = await perform_initial_setup()
|
||||||
|
|
||||||
assert result2 is False
|
assert result2 is False
|
||||||
|
|
||||||
|
|
||||||
class TestPerformNfoRepairScan:
|
|
||||||
"""Tests for the perform_nfo_repair_scan startup hook.
|
|
||||||
|
|
||||||
Note: NFO service removed, so these tests verify no-op behavior.
|
|
||||||
"""
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_skips_without_tmdb_api_key(self, tmp_path):
|
|
||||||
"""Should return immediately when no TMDB API key is configured."""
|
|
||||||
mock_settings = MagicMock()
|
|
||||||
mock_settings.tmdb_api_key = ""
|
|
||||||
mock_settings.anime_directory = str(tmp_path)
|
|
||||||
|
|
||||||
with patch(
|
|
||||||
"src.server.services.scheduler.folder_scan_service._settings", mock_settings
|
|
||||||
):
|
|
||||||
await perform_nfo_repair_scan()
|
|
||||||
|
|
||||||
# No exception means guard worked — nothing was iterated
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_skips_without_anime_directory(self, tmp_path):
|
|
||||||
"""Should return immediately when no anime directory is configured."""
|
|
||||||
mock_settings = MagicMock()
|
|
||||||
mock_settings.tmdb_api_key = "some-key"
|
|
||||||
mock_settings.anime_directory = ""
|
|
||||||
|
|
||||||
with patch(
|
|
||||||
"src.server.services.scheduler.folder_scan_service._settings", mock_settings
|
|
||||||
):
|
|
||||||
await perform_nfo_repair_scan()
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_is_no_op(self, tmp_path):
|
|
||||||
"""perform_nfo_repair_scan is now a no-op - just verify it returns without error."""
|
|
||||||
mock_settings = MagicMock()
|
|
||||||
mock_settings.tmdb_api_key = "test-key"
|
|
||||||
mock_settings.anime_directory = str(tmp_path)
|
|
||||||
|
|
||||||
series_dir = tmp_path / "MyAnime"
|
|
||||||
series_dir.mkdir()
|
|
||||||
nfo_file = series_dir / "tvshow.nfo"
|
|
||||||
nfo_file.write_text("<tvshow><title>MyAnime</title></tvshow>")
|
|
||||||
|
|
||||||
with patch(
|
|
||||||
"src.server.services.scheduler.folder_scan_service._settings", mock_settings
|
|
||||||
):
|
|
||||||
await perform_nfo_repair_scan(background_loader=AsyncMock())
|
|
||||||
|
|
||||||
# If we got here, the no-op worked correctly
|
|
||||||
|
|||||||
Reference in New Issue
Block a user