def test_start_and_stop(self):
     '''
     Basic start and stop test.
     '''
     monitors = PyUdevDeviceMonitor(0, 0, pyudev, logger=self._logger)
     monitors.start()
     self.assertTrue(monitors.running)
     monitors.stop()
     self.assertFalse(monitors.running)
 def test_stop_and_stop_again(self):
     '''
     Trying to stop twice must not fail.
     '''
     monitors = PyUdevDeviceMonitor(0, 0, pyudev, logger=self._logger)
     monitors.start()
     self.assertTrue(monitors.running)
     monitors.stop()
     self.assertFalse(monitors.running)
     monitors.stop()
     self.assertFalse(monitors.running)