Fix for Issue 3, submitted by a...@therobots.org.
This commit is contained in:
parent
aeaefb3281
commit
4378dee1ef
6
mox.py
6
mox.py
|
@ -273,6 +273,12 @@ class MockAnything:
|
|||
""" """
|
||||
self._Reset()
|
||||
|
||||
def __str__(self):
|
||||
return "<MockAnything instance at %s>" % id(self)
|
||||
|
||||
def __repr__(self):
|
||||
return self.__str__()
|
||||
|
||||
def __getattr__(self, method_name):
|
||||
"""Intercept method calls on this object.
|
||||
|
||||
|
|
|
@ -533,6 +533,10 @@ class MockAnythingTest(unittest.TestCase):
|
|||
|
||||
self.mock_object._Verify()
|
||||
|
||||
def testIsReprable(self):
|
||||
"""Test that MockAnythings can be repr'd without causing a failure."""
|
||||
self.failUnless('MockAnything' in repr(self.mock_object))
|
||||
|
||||
|
||||
class MethodCheckerTest(unittest.TestCase):
|
||||
"""Tests MockMethod's use of MethodChecker method."""
|
||||
|
|
Loading…
Reference in New Issue