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()
def __init__(self, outUnixAddr, inUnixAddr): self._inOutPort = Port(outUnixAddr, inUnixAddr) self.finished = False self.timeReturn = 17 self._lock = threading.Lock()
def __init__(self, outUnixAddr, inUnixAddr): self._inOutPort = Port(outUnixAddr, inUnixAddr)