def test_endpoint_send_with_timeout(self): e = RequestEndpointUnit() e._recv_greenlet = sentinel.recv_greenlet e.channel = Mock() self.assertRaises(exception.Timeout, e._send, sentinel.msg, Mock(), timeout=1)
def test_endpoint_send_with_timeout(self): e = RequestEndpointUnit() e.channel = Mock() e.channel.recv = lambda: sleep( 5) # simulate blocking when recv is called self.assertRaises(exception.Timeout, e._send, sentinel.msg, MagicMock(), timeout=1)
def test_endpoint_send_with_timeout(self): e = RequestEndpointUnit() e.channel = Mock() e.channel.recv = lambda: sleep(5) # simulate blocking when recv is called self.assertRaises(exception.Timeout, e._send, sentinel.msg, MagicMock(), timeout=1)
def test_endpoint_send_with_timeout(self): e = RequestEndpointUnit() e._recv_greenlet = sentinel.recv_greenlet e.channel = Mock() self.assertRaises(exception.Timeout, e._send, sentinel.msg, sentinel.headers, timeout=1)