How to use mock in Python to mock methods on objects Using mocks in Python to mock methods on objects.