test_mountinfo.py 文件源码

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

项目:landscape-client 作者: CanonicalLtd 项目源码 文件源码
def get_mount_info(self, *args, **kwargs):
        if "mounts_file" not in kwargs:
            kwargs["mounts_file"] = self.makeFile("/dev/hda1 / ext3 rw 0 0\n")
        if "mtab_file" not in kwargs:
            kwargs["mtab_file"] = self.makeFile("/dev/hda1 / ext3 rw 0 0\n")
        if "statvfs" not in kwargs:
            kwargs["statvfs"] = lambda path: os.statvfs_result(
                (0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
        plugin = MountInfo(*args, **kwargs)
        # To make sure tests are isolated from the real system by default.
        plugin.is_device_removable = lambda x: False
        return plugin
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号