You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
class Foo:
def __str__(self):
print "Foo!"
class TestSuite(unittest.TestCase):
def setUp(self):
self.m = mox.Mox()
def tearDown(self):
self.m.UnsetStubs()
def test_Foo_str(self):
f = self.m.CreateMock(Foo)
self.m.ReplayAll()
res = str(f) # res receives '<MockAnything instance at xx>'
self.m.VerifyAll()
What is the expected output? What do you see instead?
In most situations, MockObject.__str__ is useful but in some, it prevents from
testing a class's __str__ method. Instead of receiving '<MockAnything...>' in
the example above, there should be a way to make it receive "Foo!"
What version of the product are you using? On what operating system?
0.5.3
Debian GNU/Linux
Please provide any additional information below.
A short discussion was held about this subject on the mailing list[1] and it
was suggested that some mechanism could disable MockObject's additional methods.
[1]:http://groups.google.com/group/mox-discuss/browse_thread/thread/72c214e943a3
ec16
Original issue reported on code.google.com by [email protected] on 27 Sep 2010 at 6:34
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 27 Sep 2010 at 6:34The text was updated successfully, but these errors were encountered: