Пример #1
0
    def testMonitorIteration(self):
        bridge = tcTests._Bridge()
        tcTests._checkDependencies()
        mon = Monitor()
        mon.start()
        iterator = iter(mon)

        bridge.addDevice()  # Generate an event to avoid blocking
        iterator.next()

        bridge.delDevice()
        iterator.next()  # Generate an event to avoid blocking

        # Stop the monitor and check that eventually StopIteration is raised.
        # There might be other system link events so we loop to exhaust them.
        mon.stop()
        with self.assertRaises(StopIteration):
            while True:
                iterator.next()
Пример #2
0
    def testMonitorIteration(self):
        bridge = tcTests._Bridge()
        tcTests._checkDependencies()
        mon = Monitor()
        mon.start()
        iterator = iter(mon)

        bridge.addDevice()  # Generate an event to avoid blocking
        iterator.next()

        bridge.delDevice()
        iterator.next()  # Generate an event to avoid blocking

        # Stop the monitor and check that eventually StopIteration is raised.
        # There might be other system link events so we loop to exhaust them.
        mon.stop()
        with self.assertRaises(StopIteration):
            while True:
                iterator.next()
Пример #3
0
 def setUp(self):
     tcTests._checkDependencies()
     self._bridge.addDevice()
Пример #4
0
 def setUp(self):
     tcTests._checkDependencies()
     self._bridge.addDevice()
     self._unicode_bridge.devName = 'test-トトロ'
     self._unicode_bridge.addDevice()
Пример #5
0
 def setUp(self):
     _checkDependencies()
     self._bridge.addDevice()
Пример #6
0
 def setUp(self):
     tcTests._checkDependencies()
     self._bridge.addDevice()
     self._unicode_bridge.devName = 'test-トトロ'
     self._unicode_bridge.addDevice()