4
"""Catch any function or method call, and record the fact."""
6
def __init__(self, result=None, failure=None):
7
"""Set up a fake function or method.
9
:param result: Value to return.
10
:param failure: Exception to raise.
13
self.failure = failure
15
def __call__(self, *args, **kwargs):
16
"""Catch an invocation to the method."""
18
if self.failure is None: