In this section, we'll take a look at a subpackage of unit tests, called mock. The tools in the mock package help us keep our test isolated, so they aren't made to succeed or fail based on the behavior of the code, which isn't supposed to be covered by the test.
We talked about how important it is that unit tests only interact with a small section of code, but how can we arrange for this when so many pieces of code interact with objects and functions originating from all over the source tree? One answer is that we can replace those objects and functions with mock objects.