Public Member Functions | |
def | __eq__ (self, rhs) |
def | __eq__ (self, rhs) |
def | __ne__ (self, rhs) |
def | __ne__ (self, rhs) |
def | equals (self, rhs) |
def | equals (self, rhs) |
Base class for all Mox comparators. A Comparator can be used as a parameter to a mocked method when the exact value is not known. For example, the code you are testing might build up a long SQL string that is passed to your mock DAO. You're only interested that the IN clause contains the proper primary keys, so you can set your mock up as follows: mock_dao.RunQuery(StrContains('IN (1, 2, 4, 5)')).AndReturn(mock_result) Now whatever query is passed in must contain the string 'IN (1, 2, 4, 5)'. A Comparator may replace one or more parameters, for example: # return at most 10 rows mock_dao.RunQuery(StrContains('SELECT'), 10) or # Return some non-deterministic number of rows mock_dao.RunQuery(StrContains('SELECT'), IsA(int))
Definition at line 751 of file bloaty/third_party/protobuf/python/mox.py.
def mox.Comparator.__eq__ | ( | self, | |
rhs | |||
) |
Definition at line 783 of file bloaty/third_party/protobuf/python/mox.py.
def mox.Comparator.__eq__ | ( | self, | |
rhs | |||
) |
Definition at line 783 of file protobuf/python/mox.py.
def mox.Comparator.__ne__ | ( | self, | |
rhs | |||
) |
Definition at line 786 of file protobuf/python/mox.py.
def mox.Comparator.__ne__ | ( | self, | |
rhs | |||
) |
Definition at line 786 of file bloaty/third_party/protobuf/python/mox.py.
def mox.Comparator.equals | ( | self, | |
rhs | |||
) |
Special equals method that all comparators must implement. Args: rhs: any python object
Reimplemented in mox.IgnoreArg, mox.IgnoreArg, mox.Func, mox.Func, mox.Or, mox.Or, mox.And, mox.And, mox.ContainsKeyValue, mox.ContainsKeyValue, mox.In, mox.In, mox.Regex, mox.Regex, mox.StrContains, mox.StrContains, mox.IsAlmost, mox.IsAlmost, mox.IsA, mox.IsA, mox.SameElementsAs, and mox.SameElementsAs.
Definition at line 774 of file protobuf/python/mox.py.
def mox.Comparator.equals | ( | self, | |
rhs | |||
) |
Special equals method that all comparators must implement. Args: rhs: any python object
Reimplemented in mox.IgnoreArg, mox.IgnoreArg, mox.Func, mox.Func, mox.Or, mox.Or, mox.And, mox.And, mox.ContainsKeyValue, mox.ContainsKeyValue, mox.In, mox.In, mox.Regex, mox.Regex, mox.StrContains, mox.StrContains, mox.IsAlmost, mox.IsAlmost, mox.IsA, mox.IsA, mox.SameElementsAs, and mox.SameElementsAs.
Definition at line 774 of file bloaty/third_party/protobuf/python/mox.py.