def test_send_timeout_fail(self): b = ZmqEndpoint(ZmqEndpointType.bind, "ipc://#4") ZmqSlowREPConnection(self.factory, b) c = ZmqEndpoint(ZmqEndpointType.connect, "ipc://#4") s = ZmqREQConnection(self.factory, c, identity=b'client2') return s.sendMsg(b'aaa', timeout=0.05) \ .addCallbacks(lambda _: self.fail("Should timeout"), lambda fail: fail.trap(ZmqRequestTimeoutError)) \ .addCallback(lambda _: _wait(0.1))
def setUp(self): self.factory = ZmqFactory() b = ZmqEndpoint(ZmqEndpointType.bind, "ipc://#3") self.r = ZmqTestREPConnection(self.factory, b) c = ZmqEndpoint(ZmqEndpointType.connect, "ipc://#3") self.s = ZmqREQConnection(self.factory, c, identity=b'client')