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

Public Member Functions

def __init__ (self, float_value, places=7)
 
def __init__ (self, float_value, places=7)
 
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

 _float_value
 
 _places
 

Detailed Description

Comparison class used to check whether a parameter is nearly equal
to a given value.  Generally useful for floating point numbers.

Example mock_dao.SetTimeout((IsAlmost(3.9)))

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

Constructor & Destructor Documentation

◆ __init__() [1/2]

def mox.IsAlmost.__init__ (   self,
  float_value,
  places = 7 
)
Initialize IsAlmost.

Args:
  float_value: The value for making the comparison.
  places: The number of decimal places to round to.

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

◆ __init__() [2/2]

def mox.IsAlmost.__init__ (   self,
  float_value,
  places = 7 
)
Initialize IsAlmost.

Args:
  float_value: The value for making the comparison.
  places: The number of decimal places to round to.

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

Member Function Documentation

◆ __repr__() [1/2]

def mox.IsAlmost.__repr__ (   self)

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

◆ __repr__() [2/2]

def mox.IsAlmost.__repr__ (   self)

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

◆ equals() [1/2]

def mox.IsAlmost.equals (   self,
  rhs 
)
Check to see if RHS is almost equal to float_value

Args:
  rhs: the value to compare to float_value

Returns:
  bool

Reimplemented from mox.Comparator.

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

◆ equals() [2/2]

def mox.IsAlmost.equals (   self,
  rhs 
)
Check to see if RHS is almost equal to float_value

Args:
  rhs: the value to compare to float_value

Returns:
  bool

Reimplemented from mox.Comparator.

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

Member Data Documentation

◆ _float_value

mox.IsAlmost._float_value
private

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

◆ _places

mox.IsAlmost._places
private

Definition at line 844 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