Hey Daniel, thanks :)

I mentioned in the article that I decided to focus on testing functions that use our module instead of testing the module it self.

There is some debate about testing external services. I side for those who say you should test everything (and I do!) :)

The simplest way I found to test external modules such as this one (HTTP) is using the responses package — a great requests mocking library by the sentry guys.

If you want to see an example of testing external services using responses just happen to stumble across a great one by google — google maps API client.

Hope this helps fill the gap :)

Full Stack Developer, Team Leader, Independent. More from me at https://hakibenita.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store