def test_event_register(self): """Checks that VirtController.event_register() properly calls virEventRunDefaultImpl() function of Libvirt """ with mock.patch('libvirt.virEventRunDefaultImpl',) as m: VirtController.event_run() m.assert_called_once_with()
def run_event_loop(self): """ run_event_loop: Starts libvirt event loop """ # In race conditions on python interpreter exit, libvirt sometimes # becomes None. So loop conditioner tests if it is still defined in # order to avoid errors. while not self._stop.is_set(): VirtController.event_run()