예제 #1
0
    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()
예제 #2
0
    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()