refactoring backup

This commit is contained in:
2025-11-02 09:52:43 +01:00
parent ca4bf72fde
commit 2de3317aee
4 changed files with 90 additions and 637 deletions

View File

@@ -353,59 +353,6 @@ class TestSeriesAppReScan:
assert "cancelled" in result.message.lower()
class TestSeriesAppAsync:
"""Test async operations."""
@pytest.mark.asyncio
@patch('src.core.SeriesApp.Loaders')
@patch('src.core.SeriesApp.SerieScanner')
@patch('src.core.SeriesApp.SerieList')
async def test_async_download(
self, mock_serie_list, mock_scanner, mock_loaders
):
"""Test async download."""
test_dir = "/test/anime"
app = SeriesApp(test_dir)
# Mock download
app.loader.Download = Mock()
# Perform async download
result = await app.async_download(
"anime_folder",
season=1,
episode=1,
key="anime_key"
)
# Verify result
assert isinstance(result, OperationResult)
assert result.success is True
@pytest.mark.asyncio
@patch('src.core.SeriesApp.Loaders')
@patch('src.core.SeriesApp.SerieScanner')
@patch('src.core.SeriesApp.SerieList')
async def test_async_rescan(
self, mock_serie_list, mock_scanner, mock_loaders
):
"""Test async rescan."""
test_dir = "/test/anime"
app = SeriesApp(test_dir)
# Mock scanner
app.SerieScanner.GetTotalToScan = Mock(return_value=5)
app.SerieScanner.Reinit = Mock()
app.SerieScanner.Scan = Mock()
# Perform async rescan
result = await app.async_rescan()
# Verify result
assert isinstance(result, OperationResult)
assert result.success is True
class TestSeriesAppCancellation:
"""Test operation cancellation."""