#Phil.McLachlan - Python + Checkout

1 messages · Page 1 of 1 (latest)

grand sleet
slender pewter
#

Thanks, but I was looking more for a way to mock the call to Stripe, instead of testing Stripe with a call to it.

grand sleet
slender pewter
#

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?

grand sleet
#

I'm not quite sure what you mean. Is there a specific scenario you're trying to test, or data you're looking for?

slender pewter
#

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?

grand sleet
#

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