def test_callbacks_are_invoked_with_connections(self):
    '\n        The first arguments to both callbacks are their respective connections.\n        '
    client_calls = []
    server_calls = []

    def client_callback(conn, *args, **kwargs):
        client_calls.append(conn)
        return True

    def server_callback(conn, *args, **kwargs):
        server_calls.append(conn)
        return self.sample_ocsp_data
    client = self._client_connection(callback=client_callback, data=None)
    server = self._server_connection(callback=server_callback, data=None)
    handshake_in_memory(client, server)
    assert (len(client_calls) == 1)
    assert (len(server_calls) == 1)
    assert (client_calls[0] is client)
    assert (server_calls[0] is server)
The first arguments to both callbacks are their respective connections.
def test_callbacks_are_invoked_with_connections(self):
    '\n        \n        '
    client_calls = []
    server_calls = []

    def client_callback(conn, *args, **kwargs):
        client_calls.append(conn)
        return True

    def server_callback(conn, *args, **kwargs):
        server_calls.append(conn)
        return self.sample_ocsp_data
    client = self._client_connection(callback=client_callback, data=None)
    server = self._server_connection(callback=server_callback, data=None)
    handshake_in_memory(client, server)
    assert (len(client_calls) == 1)
    assert (len(server_calls) == 1)
    assert (client_calls[0] is client)
    assert (server_calls[0] is server)