queue fix
This commit is contained in:
@@ -111,10 +111,16 @@ async def test_get_queue_status(authenticated_client, mock_download_service):
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
|
||||
assert "status" in data
|
||||
# Updated to match new response structure
|
||||
assert "is_running" in data
|
||||
assert "is_paused" in data
|
||||
assert "active_downloads" in data
|
||||
assert "pending_queue" in data
|
||||
assert "completed_downloads" in data
|
||||
assert "failed_downloads" in data
|
||||
assert "statistics" in data
|
||||
assert data["status"]["is_running"] is True
|
||||
assert data["status"]["is_paused"] is False
|
||||
assert data["is_running"] is True
|
||||
assert data["is_paused"] is False
|
||||
|
||||
mock_download_service.get_queue_status.assert_called_once()
|
||||
mock_download_service.get_queue_stats.assert_called_once()
|
||||
|
||||
@@ -153,15 +153,14 @@ class TestDownloadFlowEndToEnd:
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
|
||||
# Verify status structure
|
||||
assert "status" in data
|
||||
# Verify status structure (updated for new response format)
|
||||
assert "is_running" in data
|
||||
assert "is_paused" in data
|
||||
assert "pending_queue" in data
|
||||
assert "active_downloads" in data
|
||||
assert "completed_downloads" in data
|
||||
assert "failed_downloads" in data
|
||||
assert "statistics" in data
|
||||
|
||||
status = data["status"]
|
||||
assert "pending" in status
|
||||
assert "active" in status
|
||||
assert "completed" in status
|
||||
assert "failed" in status
|
||||
|
||||
async def test_add_with_different_priorities(self, authenticated_client):
|
||||
"""Test adding episodes with different priority levels."""
|
||||
@@ -292,11 +291,11 @@ class TestDownloadProgressTracking:
|
||||
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
assert "status" in data
|
||||
# Updated for new response format
|
||||
assert "active_downloads" in data
|
||||
|
||||
# Check that items can have progress
|
||||
status = data["status"]
|
||||
for item in status.get("active", []):
|
||||
for item in data.get("active_downloads", []):
|
||||
if "progress" in item and item["progress"]:
|
||||
assert "percentage" in item["progress"]
|
||||
assert "current_mb" in item["progress"]
|
||||
@@ -358,13 +357,18 @@ class TestErrorHandlingAndRetries:
|
||||
|
||||
if add_response.status_code == 201:
|
||||
# Get queue status to check retry count
|
||||
status_response = await authenticated_client.get("/api/queue/status")
|
||||
|
||||
status_response = await authenticated_client.get(
|
||||
"/api/queue/status"
|
||||
)
|
||||
|
||||
if status_response.status_code == 200:
|
||||
data = status_response.json()
|
||||
# Verify structure includes retry_count field
|
||||
for item_list in [data["status"].get("pending", []),
|
||||
data["status"].get("failed", [])]:
|
||||
# Updated to match new response structure
|
||||
for item_list in [
|
||||
data.get("pending_queue", []),
|
||||
data.get("failed_downloads", [])
|
||||
]:
|
||||
for item in item_list:
|
||||
assert "retry_count" in item
|
||||
|
||||
|
||||
Reference in New Issue
Block a user