Ejemplo n.º 1
0
    def test_inOutPort_basic(self):

        inPort = InPort(PortTest.UNIX_FIRST_ADDR)
        inOutPort = Port(PortTest.UNIX_FIRST_ADDR, PortTest.UNIX_SECOND_ADDR)
        outPort = OutPort(PortTest.UNIX_SECOND_ADDR)

        inPort.listen()
        inOutPort.initialize()
        outPort.connect()

        event = 'foo'
        outPort.send(event)
        self.assertEqual(event, inOutPort.receive(1.0))

        event2 = 'bar'
        inOutPort.send(event2)
        self.assertEqual(event2, inPort.receive(1.0))

        inPort.dispose()
        inOutPort.dispose()
Ejemplo n.º 2
0
 def __init__(self, outUnixAddr, inUnixAddr):
     self._inOutPort = Port(outUnixAddr, inUnixAddr)
     self.finished = False
     self.timeReturn = 17
     self._lock = threading.Lock()
Ejemplo n.º 3
0
 def __init__(self, outUnixAddr, inUnixAddr):
     self._inOutPort = Port(outUnixAddr, inUnixAddr)