parameters: (self, *params, **named_params)
return_statement: return mock_method(*params, **named_params)
docstring: Provide custom logic for mocking classes that are callable.
docstring_summary: Provide custom logic for mocking classes that are callable.
docstring_tokens: Provide custom logic for mocking classes that are callable .
function: def __call__(self, *params, **named_params):
      """Provide custom logic for mocking classes that are callable."""
  
      # Verify the class we are mocking is callable
      callable = self._class_to_mock.__dict__.get('__call__', None)
      if callable is None:
        raise TypeError('Not callable')
  
      # Because the call is happening directly on this object instead of a method,
      # the call on the mock method is made right here
      mock_method = self._CreateMockMethod('__call__')
      return mock_method(*params, **named_params)
function_tokens: def __call__ ( self , * params , * * named_params ) : # Verify the class we are mocking is callable callable = self . _class_to_mock . __dict__ . get ( '__call__' , None ) if callable is None : raise TypeError ( 'Not callable' ) # Because the call is happening directly on this object instead of a method, # the call on the mock method is made right here mock_method = self . _CreateMockMethod ( '__call__' ) return mock_method ( * params , * * named_params )