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
classFoo:
def__str__(self):
print"Foo!"classTestSuite(unittest.TestCase):
defsetUp(self):
self.m=mox.Mox()
deftearDown(self):
self.m.UnsetStubs()
deftest_Foo_str(self):
f=self.m.CreateMock(Foo)
self.m.ReplayAll()
res=str(f) # res receives '<MockAnything instance at xx>'self.m.VerifyAll()
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!"
The text was updated successfully, but these errors were encountered:
In most situations,
MockObject.__str__
is useful but in some, it prevents fromtesting a class's str method. Instead of receiving
'<MockAnything...>'
inthe example above, there should be a way to make it receive
"Foo!"
The text was updated successfully, but these errors were encountered: