#Phil.McLachlan - Python + Checkout
1 messages · Page 1 of 1 (latest)
Is this what you're looking for? https://github.com/stripe/stripe-python/blob/master/tests/api_resources/checkout/test_session.py
Thanks, but I was looking more for a way to mock the call to Stripe, instead of testing Stripe with a call to it.
Ah, got it! Let me know if this would be helpful: https://github.com/stripe/stripe-mock
This is interesting. I was looking more for how to unit test a python method that calls Stripe. I didn't see any example code for stripe-mock. Can you monkey patch the stripe api?
I'm not quite sure what you mean. Is there a specific scenario you're trying to test, or data you're looking for?
Currently, the unit test triggers a call to Stripe. I want to replace that with a mock call to Stripe in my unit test. Is that how it is usually done?
I believe the Github repo for stripe-mock is the only tool we have for this at the moment. The Stripe client libraries don't have a built-in way to mock calls to Stripe