In this tutorial, you’ll learn how to unit test code that performs HTTP requests. In other words, you’ll see the art of API unit testing in Python.
Unit tests are meant to test a single unit of behavior. In testing, a well-known rule of thumb is to isolate code that reaches external dependencies.
For instance, when testing a code that performs HTTP requests, it’s recommended to replace the real call with a fake call during test time. This way, you can unit test it without performing a real HTTP request every time you run the test.
Powered by WPeMatico