Repository navigation
test(integration): align with v2.4.0 client-side limit validation + V1 batch typed responses - #238
Conversation
…1 batch typed responses Two distinct breakages on the nightly run against demo: 1. test_malformed_params_returns_validation_error + test_validation_error_details_attribute used limit=-1 to trigger a server 400. W1-B (#214) added client-side _validate_limit which raises ValueError before the request reaches the server. Switched the trigger to a malformed cursor — the SDK forwards it verbatim and the server still returns 400. 2. test_batch_create_cancel (sync + async) asserted isinstance(orders, list). W1-B (#194) made batch_create return BatchCreateOrdersResponse. Tests now iterate response.orders[i].order, treat None .order as a failed leg, and reduce to successful order_ids for cleanup. Closes #237
Code Review — PR #238Overview: Fixes the nightly integration suite after v2.4.0 by updating two test files to match current SDK behavior: replacing What's Good
Issues / Suggestions1. assert successful, f"All legs failed: {response.orders}"
errors = [e.error for e in response.orders if e.order is None]
assert successful, f"All legs failed. Errors: {errors}"This is a minor readability concern, not a correctness issue. 2. The malformed-cursor test depends on server behavior (medium) sync_client.markets.list(cursor="!!!not-a-valid-cursor!!!")The original 3. The second test at line 102 only checks that 4. No unit-test counterpart for the There's no non-integration test asserting that SummaryThe changes are correct, minimal, and well-explained. The only actionable suggestion before merge is improving the Verdict: Approve with minor suggestion on the failure message. |
Fixes #237 — nightly integration suite was red after v2.4.0 because two test files asserted pre-audit behavior:
Changes
test_malformed_params_returns_validation_error+test_validation_error_details_attributeswitched fromlimit=-1(now blocked by Resources: validate "limit" ranges client-side per spec bounds #214's client-side validation) to a malformed cursor that the SDK forwards verbatim and the server still 400s.test_batch_create_cancel(sync + async) updated for Orders: V1 batch_create / batch_cancel must return typed per-leg responses (partial-success defect) #194's typedBatchCreateOrdersResponse: iteratesresponse.orders[i].order, treatsNone .orderas a failed leg, reduces to successfulorder_idsfor teardown.Closes #237