mocking considerations decide what to mocktypical examples of what to mock include those elements that are not yet availablethose elements that are not by default repeatable (such as live data feedsor those elements of the system that are time consuming or complex decide where to mock such as the interfaces for the unit under test you want to test the unit so any interface it has with another systemfunctionclass might be candidate for mock decide when to mock so that you can determine the boundaries for the test decide how you will implement your mocks for example you need to consider which mocking framework(syou will use or how to mock larger components such as database online resources there is great deal of information available on how to mockwhen to mock and what mock libraries to usehowever the following provides useful starting points for python mockinglibrary documentation on the unitest mock library source mock object framework for python library for python exercises one of the reasons for mocking is to ensure that tests are repeatable in this exercise we will mock out the use of random number generate to ensure that our tests can be easily repeated the following program generates deck of cards and randomly picks card from the deck