test_cephdisks.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:DeepSea 作者: SUSE 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号