diff options
author | smiddlek <smiddlek@b1010a0a-674b-0410-b734-77272b80c875> | 2009-05-05 22:54:33 +0000 |
---|---|---|
committer | smiddlek <smiddlek@b1010a0a-674b-0410-b734-77272b80c875> | 2009-05-05 22:54:33 +0000 |
commit | 7671c9a9432698f1879540621e68bfa335f95f10 (patch) | |
tree | 8cf710f95053ad40fba33d4701de16f69a8fa468 | |
parent | a1c509d6722daa1163441cc545a79248d811e41e (diff) | |
download | mox-7671c9a9432698f1879540621e68bfa335f95f10.tar.gz |
Fix for Issue 3, submitted by a...@therobots.org.
git-svn-id: http://pymox.googlecode.com/svn/trunk@29 b1010a0a-674b-0410-b734-77272b80c875
-rwxr-xr-x | mox.py | 6 | ||||
-rwxr-xr-x | mox_test.py | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -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. diff --git a/mox_test.py b/mox_test.py index 52b5905..5519a7f 100755 --- a/mox_test.py +++ b/mox_test.py @@ -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.""" |