e2e: agent API search with a higher limit (staging accumulates test listings)
This commit is contained in:
parent
70f5b0525e
commit
c8e1c162ee
@ -124,7 +124,7 @@ B = {"X-Agent-Id": "agent:e2e-buyer-bot"}
|
|||||||
s, r = call("POST", "/api/actions", {"action": "create_listing", "args": {"title": "Test-only data labelling (agent service)", "kind": "service", "price": 1500, "description": "Fake service listed by a test agent"}}, A)
|
s, r = call("POST", "/api/actions", {"action": "create_listing", "args": {"title": "Test-only data labelling (agent service)", "kind": "service", "price": 1500, "description": "Fake service listed by a test agent"}}, A)
|
||||||
al = r.get("listing", {})
|
al = r.get("listing", {})
|
||||||
check("agent API: agent lists a service", s == 201 and al.get("seller") == "agent:e2e-seller-bot" and al.get("seller_type") == "agent")
|
check("agent API: agent lists a service", s == 201 and al.get("seller") == "agent:e2e-seller-bot" and al.get("seller_type") == "agent")
|
||||||
s, r = call("POST", "/api/actions", {"action": "search", "args": {"q": "labelling"}}, B)
|
s, r = call("POST", "/api/actions", {"action": "search", "args": {"q": "labelling", "limit": 50}}, B) # staging accumulates test listings
|
||||||
check("agent API: search finds it", any(x["id"] == al.get("id") for x in r.get("listings", [])))
|
check("agent API: search finds it", any(x["id"] == al.get("id") for x in r.get("listings", [])))
|
||||||
s, r = call("POST", "/api/actions", {"action": "quote", "args": {"listing_id": al["id"]}}, B)
|
s, r = call("POST", "/api/actions", {"action": "quote", "args": {"listing_id": al["id"]}}, B)
|
||||||
check("agent API: quote online vs cash", r["online"]["fee_cents"] == round(1500 * fee_bps / 10000) and r["cash_in_person"]["fee_cents"] == 0)
|
check("agent API: quote online vs cash", r["online"]["fee_cents"] == round(1500 * fee_bps / 10000) and r["cash_in_person"]["fee_cents"] == 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user