def test_renegotiate(self):
    '\n        Go through a complete renegotiation cycle.\n        '
    (server, client) = loopback((lambda s: loopback_server_factory(s, TLSv1_2_METHOD)), (lambda s: loopback_client_factory(s, TLSv1_2_METHOD)))
    server.send(b'hello world')
    assert (b'hello world' == client.recv(len(b'hello world')))
    assert (0 == server.total_renegotiations())
    assert (False is server.renegotiate_pending())
    assert (True is server.renegotiate())
    assert (True is server.renegotiate_pending())
    server.setblocking(False)
    client.setblocking(False)
    client.do_handshake()
    server.do_handshake()
    assert (1 == server.total_renegotiations())
    while (False is server.renegotiate_pending()):
        pass
Go through a complete renegotiation cycle.
def test_renegotiate(self):
    '\n        \n        '
    (server, client) = loopback((lambda s: loopback_server_factory(s, TLSv1_2_METHOD)), (lambda s: loopback_client_factory(s, TLSv1_2_METHOD)))
    server.send(b'hello world')
    assert (b'hello world' == client.recv(len(b'hello world')))
    assert (0 == server.total_renegotiations())
    assert (False is server.renegotiate_pending())
    assert (True is server.renegotiate())
    assert (True is server.renegotiate_pending())
    server.setblocking(False)
    client.setblocking(False)
    client.do_handshake()
    server.do_handshake()
    assert (1 == server.total_renegotiations())
    while (False is server.renegotiate_pending()):
        pass