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

Public Member Functions

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

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)))

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ __repr__()

def mox.IsAlmost.__repr__ (   self)

◆ equals()

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

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