def hwd(self):
"""
Patching hw_detection_method in the __init__ function
of HardwareDetections to allow sudoless test execution
Patched method are tested separately.
scope: class
return: instance of
<class srv.salt._modules.cephdisks.HardwareDetections>
"""
self.hw_detection_method = patch('srv.salt._modules.cephdisks.HardwareDetections._find_detection_tool')
self.hw_dtctr = self.hw_detection_method.start()
self.hw_dtctr.return_value = '/a/valid/path'
yield cephdisks.HardwareDetections()
self.hw_detection_method.stop()
评论列表
文章目录