私はクラスを持っています:
class MyClass(object):
@property
def myproperty(self):
return 'hello'
とを使用mox
してpy.test
、どのようにモックアウトしmyproperty
ますか?
私はもう試した:
mock.StubOutWithMock(myclass, 'myproperty')
myclass.myproperty = 'goodbye'
と
mock.StubOutWithMock(myclass, 'myproperty')
myclass.myproperty.AndReturns('goodbye')
しかし、両方ともで失敗しAttributeError: can't set attribute
ます。