fix tests
This commit is contained in:
@@ -13,7 +13,7 @@ import asyncio
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
from unittest.mock import AsyncMock, Mock
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
@@ -89,13 +89,10 @@ def mock_anime_service(mock_series_app, tmp_path):
|
||||
test_dir = tmp_path / "anime"
|
||||
test_dir.mkdir()
|
||||
|
||||
with patch(
|
||||
"src.server.services.anime_service.SeriesApp",
|
||||
return_value=mock_series_app
|
||||
):
|
||||
service = AnimeService(directory=str(test_dir))
|
||||
service.download = AsyncMock(return_value=True)
|
||||
yield service
|
||||
# Create AnimeService with the mocked SeriesApp
|
||||
service = AnimeService(series_app=mock_series_app)
|
||||
service.download = AsyncMock(return_value=True)
|
||||
return service
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -537,7 +534,7 @@ class TestCompleteDownloadWorkflow:
|
||||
assert status_response.status_code in [200, 503]
|
||||
|
||||
# 3. Start queue processing
|
||||
start_response = await authenticated_client.post("/api/queue/control/start")
|
||||
start_response = await authenticated_client.post("/api/queue/start")
|
||||
assert start_response.status_code in [200, 503]
|
||||
|
||||
# 4. Check status during processing
|
||||
|
||||
Reference in New Issue
Block a user