fix(06): WR-03 fix locust load test document list shape mismatch
The GET /api/documents/ response is {items: [...], total: N, ...} not a
bare list. Change docs = resp.json() to resp.json().get("items", []) so
get_document task correctly accesses docs[0]["id"] without TypeError.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4a5719311b
commit
013802aa74
@@ -77,7 +77,7 @@ class DocuVaultUser(HttpUser):
|
|||||||
name="GET /api/documents/ (for get_document)",
|
name="GET /api/documents/ (for get_document)",
|
||||||
)
|
)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
docs = resp.json()
|
docs = resp.json().get("items", [])
|
||||||
if docs:
|
if docs:
|
||||||
doc_id = docs[0]["id"]
|
doc_id = docs[0]["id"]
|
||||||
self.client.get(
|
self.client.get(
|
||||||
|
|||||||
Reference in New Issue
Block a user