fixed some tests
This commit is contained in:
@@ -73,15 +73,16 @@ class TestQueueDisplay:
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
|
||||
# Verify structure
|
||||
assert "is_running" in data
|
||||
# Verify top-level structure
|
||||
assert "status" in data
|
||||
assert "statistics" in data
|
||||
|
||||
# Verify status nested structure
|
||||
status = data["status"]
|
||||
assert "active" in status
|
||||
assert "pending" in status
|
||||
assert "completed" in status
|
||||
assert "failed" in status
|
||||
assert "active_downloads" in status
|
||||
assert "pending_queue" in status
|
||||
assert "completed_downloads" in status
|
||||
assert "failed_downloads" in status
|
||||
assert "is_running" in status
|
||||
assert "is_paused" in status
|
||||
|
||||
@@ -107,7 +108,8 @@ class TestQueueDisplay:
|
||||
assert response.status_code == 200
|
||||
|
||||
data = response.json()
|
||||
pending = data["pending_queue"]
|
||||
# Updated for nested status structure
|
||||
pending = data["status"]["pending_queue"]
|
||||
|
||||
assert len(pending) > 0
|
||||
item = pending[0]
|
||||
@@ -140,7 +142,7 @@ class TestQueueReordering:
|
||||
)
|
||||
existing_items = [
|
||||
item["id"]
|
||||
for item in status_response.json()["pending_queue"]
|
||||
for item in status_response.json()["status"]["pending_queue"]
|
||||
]
|
||||
if existing_items:
|
||||
await client.request(
|
||||
@@ -190,7 +192,7 @@ class TestQueueReordering:
|
||||
)
|
||||
current_order = [
|
||||
item["id"]
|
||||
for item in status_response.json()["pending_queue"]
|
||||
for item in status_response.json()["status"]["pending_queue"]
|
||||
]
|
||||
|
||||
assert current_order == new_order
|
||||
@@ -270,7 +272,7 @@ class TestQueueControl:
|
||||
"/api/queue/status",
|
||||
headers=auth_headers
|
||||
)
|
||||
assert status.json()["is_running"] is False
|
||||
assert status.json()["status"]["is_running"] is False
|
||||
|
||||
# Start queue
|
||||
await client.post("/api/queue/start", headers=auth_headers)
|
||||
@@ -280,7 +282,7 @@ class TestQueueControl:
|
||||
"/api/queue/status",
|
||||
headers=auth_headers
|
||||
)
|
||||
assert status.json()["is_running"] is True
|
||||
assert status.json()["status"]["is_running"] is True
|
||||
|
||||
# Stop queue
|
||||
await client.post("/api/queue/stop", headers=auth_headers)
|
||||
@@ -290,7 +292,7 @@ class TestQueueControl:
|
||||
"/api/queue/status",
|
||||
headers=auth_headers
|
||||
)
|
||||
assert status.json()["is_running"] is False
|
||||
assert status.json()["status"]["is_running"] is False
|
||||
|
||||
|
||||
class TestCompletedDownloads:
|
||||
@@ -323,7 +325,7 @@ class TestCompletedDownloads:
|
||||
data = status.json()
|
||||
|
||||
completed_count = data["statistics"]["completed_count"]
|
||||
completed_list = len(data["completed_downloads"])
|
||||
completed_list = len(data["status"]["completed_downloads"])
|
||||
|
||||
# Count should match list length
|
||||
assert completed_count == completed_list
|
||||
@@ -390,7 +392,7 @@ class TestFailedDownloads:
|
||||
data = status.json()
|
||||
|
||||
failed_count = data["statistics"]["failed_count"]
|
||||
failed_list = len(data["failed_downloads"])
|
||||
failed_list = len(data["status"]["failed_downloads"])
|
||||
|
||||
# Count should match list length
|
||||
assert failed_count == failed_list
|
||||
@@ -443,7 +445,7 @@ class TestBulkOperations:
|
||||
"/api/queue/status",
|
||||
headers=auth_headers
|
||||
)
|
||||
pending = status.json()["status"]["pending"]
|
||||
pending = status.json()["status"]["pending_queue"]
|
||||
|
||||
if pending:
|
||||
item_ids = [item["id"] for item in pending]
|
||||
@@ -463,4 +465,4 @@ class TestBulkOperations:
|
||||
"/api/queue/status",
|
||||
headers=auth_headers
|
||||
)
|
||||
assert len(status.json()["status"]["pending"]) == 0
|
||||
assert len(status.json()["status"]["pending_queue"]) == 0
|
||||
|
||||
Reference in New Issue
Block a user