webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | List of all members
mox.Func Class Reference
Inheritance diagram for mox.Func:
mox.Comparator

Public Member Functions

def __init__ (self, func)
 
def equals (self, rhs)
 
def __repr__ (self)
 
- Public Member Functions inherited from mox.Comparator
def equals (self, rhs)
 
def __eq__ (self, rhs)
 
def __ne__ (self, rhs)
 

Detailed Description

Call a function that should verify the parameter passed in is correct.

You may need the ability to perform more advanced operations on the parameter
in order to validate it.  You can use this to have a callable validate any
parameter. The callable should return either True or False.


Example:

def myParamValidator(param):
  # Advanced logic here
  return True

mock_dao.DoSomething(Func(myParamValidator), true)

Constructor & Destructor Documentation

◆ __init__()

def mox.Func.__init__ (   self,
  func 
)
Initialize.

Args:
  func: callable that takes one parameter and returns a bool

Member Function Documentation

◆ __repr__()

def mox.Func.__repr__ (   self)

◆ equals()

def mox.Func.equals (   self,
  rhs 
)
Test whether rhs passes the function test.

rhs is passed into func.

Args:
  rhs: any python object

Returns:
  the result of func(rhs)

The documentation for this class was generated from the following file: