Public Member Functions | Private Attributes | List of all members
mox.Func Class Reference
Inheritance diagram for mox.Func:
Inheritance graph
[legend]

Public Member Functions

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

Private Attributes

 _func
 

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)

Definition at line 1112 of file bloaty/third_party/protobuf/python/mox.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

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

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

Definition at line 1129 of file bloaty/third_party/protobuf/python/mox.py.

◆ __init__() [2/2]

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

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

Definition at line 1129 of file protobuf/python/mox.py.

Member Function Documentation

◆ __repr__() [1/2]

def mox.Func.__repr__ (   self)

Definition at line 1152 of file bloaty/third_party/protobuf/python/mox.py.

◆ __repr__() [2/2]

def mox.Func.__repr__ (   self)

Definition at line 1152 of file protobuf/python/mox.py.

◆ equals() [1/2]

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)

Reimplemented from mox.Comparator.

Definition at line 1138 of file protobuf/python/mox.py.

◆ equals() [2/2]

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)

Reimplemented from mox.Comparator.

Definition at line 1138 of file bloaty/third_party/protobuf/python/mox.py.

Member Data Documentation

◆ _func

mox.Func._func
private

Definition at line 1136 of file bloaty/third_party/protobuf/python/mox.py.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:41