'Given an object (class instance or module) and a registration
name, then replace all its methods with mock function objects
(passing the orignal functions to the mock functions).'

def mock_up(self, obj, name, default_ret_val=None):

    for symbol in dir(obj):
        if symbol.startswith('__'):
            continue
        orig_symbol = getattr(obj, symbol)
        if callable(orig_symbol):
            f_name = ('%s.%s' % (name, symbol))
            func = mask_function(f_name, orig_symbol, default_ret_val, self.__record_call, self.__method_playback)
            setattr(obj, symbol, func)
