test_mountinfo.py 文件源码

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

项目:landscape-client 作者: CanonicalLtd 项目源码 文件源码
def test_resynchronize(self):
        """
        On the reactor "resynchronize" event, new mount-info messages
        should be sent.
        """
        plugin = self.get_mount_info(
            create_time=self.reactor.time, statvfs=statvfs_result_fixture)
        self.monitor.add(plugin)

        plugin.run()
        plugin.exchange()
        self.reactor.fire("resynchronize", scopes=["disk"])
        plugin.run()
        plugin.exchange()
        messages = self.mstore.get_pending_messages()
        messages = [message for message in messages
                    if message["type"] == "mount-info"]
        expected_message = {
            "type": "mount-info",
            "mount-info": [(0, {"device": "/dev/hda1", "mount-point": "/",
                                "total-space": 4096000,
                                "filesystem": "ext3"})]}
        self.assertMessages(messages, [expected_message, expected_message])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号