Repository navigation
feat: add integration tests for incoming payments - #15
Conversation
COMPUMAX-EC
left a comment
There was a problem hiding this comment.
Thanks for picking up #5! I checked out this branch and ran the new tests locally (Windows, Python 3.14), and all 3 pass.
Looking closer, though, I don't think they exercise the incoming payment endpoints yet. All three tests only call op_client.wallet.get_wallet_address(...), which test_wallet.py already covers. test_create_incoming_payment builds an IncomingPaymentRequest but never sends it, and the get and list tests don't fetch any incoming payment.
A few suggestions:
- Call the SDK methods the tests are named after. Get an access token with
op_client.grants.post_grant_request(...), astest_grants.pydoes with thegrant_req_dtofixture. Then callop_client.incoming_payments.post_create_payment(...)withstr(wallet.resourceServer),get_incoming_payment(...)with the returned id, andget_incoming_payments(...), and assert on the responses (for examplewalletAddressandincomingAmount). expiresAt="2026-12-31T23:59:59Z"will be in the past in a few weeks. Something likedatetime.now(timezone.utc) + timedelta(days=1)would keep the test valid.- The wallet URL is repeated three times. A fixture in
conftest.py, like the existingwallet_address_server, would avoid that. - Small things:
import pytestis unused, and the file has no newline at the end.
One question: #11 mentions Pydantic validation errors on real responses, for example the required updatedAt field missing. Did you run into that when calling the incoming payment endpoints? If so, it may be worth mentioning here, or building on #12.
Also, CI currently runs only tests/unit/, so these integration tests won't run automatically on PRs.
|
Thanks @3n3gma for picking up #5 and contributing a starting structure for incoming-payment integration coverage. We’re proceeding with merging this contribution after #12 and #14, then extending it against the combined SDK. The current cases exercise wallet discovery and request construction; we’ll carry the endpoint-coverage improvements identified in the review into follow-up changes. That work will:
We’ll keep #5 open until the intended endpoint coverage is complete. This contribution gives us a starting point for that coverage as we bring Python to parity with the other SDKs. |
This PR adds integration tests for the incoming payments endpoints, addressing issue #5.
Tests added:
All tests verified locally against the Interledger test server — 3 passed.