mollie / mollie-api-python

Mollie API client for Python
http://www.mollie.com
BSD 2-Clause "Simplified" License
113 stars 55 forks source link

Functionality for unit testing #58

Closed mbtronics closed 6 years ago

mbtronics commented 6 years ago

Hi,

I'm trying to unit test a python application that uses mollie. Is there any possibility for using the library in a unit test without access / valid key? Are there any mocks?

If I write basic mocking functionality myself, is there a chance to get it included?

mvdpanne commented 6 years ago

Hi mbtronics,

When testing your application, you should be able to mock the Mollie API client just fine with the built-in libraries. The client does not require an actual valid api key. It only needs to start with test_ or live_. Only when outgoing calls are made, the key will be validated.

Mocking functionality is not a responsibility of the API client, and therefore won't be included in the repository.