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])
评论列表
文章目录