我在
notifier
文件中得到了我要测试的方法:
def notify():
Class_A.another_class_method()
Class A:
@classmethod
def prepare():
helper_method()
def another_class_method():
prepare()
我需要模拟 helper_method。 我该怎么做?
我正在尝试像这样修补它:
with patch(
'notifier.notify.Class_A.another_class_method.prepare.helper_method',
return_value=True
)
但这行不通。