':py:obj:`Connection` methods which generate output raise
:py:obj:`OpenSSL.SSL.WantWriteError` if writing to the connection\'s BIO
fail indicating a should-write state.'

def test_wantWriteError(self):

    (client_socket, server_socket) = socket_pair()
    msg = 'x'
    for i in range(((1024 * 1024) * 4)):
        try:
            client_socket.send(msg)
        except error as e:
            if (e.errno == EWOULDBLOCK):
                break
            raise
    else:
        self.fail('Failed    to    fill    socket    buffer,    cannot    test    BIO    want    write')
    ctx = Context(TLSv1_METHOD)
    conn = Connection(ctx, client_socket)
    conn.set_connect_state()
    self.assertRaises(WantWriteError, conn.do_handshake)
