queue fix

This commit is contained in:
2025-11-01 15:43:15 +01:00
parent 3be175522f
commit 3c6d82907d
6 changed files with 175 additions and 1456 deletions

View File

@@ -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