【发布时间】:2009-11-05 18:15:34
【问题描述】:
我有一个方法调用另一个类的类方法
def get_interface_params_by_mac(self, host, mac_unified):
lines = RemoteCommand.remote_command(host, cls.IFCONFIG)
...
class RemoteCommand(object):
@classmethod
def remote_command(cls, host, cmd, sh = None):
...
我将为 get_interface_params_by_mac 方法编写一个单元测试,我想在其中更改 remote_command 的实现(我认为它调用存根 - 修复如果我错了,我)
在 Python 中执行此操作的正确方法是什么?
【问题讨论】:
标签: python unit-testing