def test_accept(self):
    '\n        `Connection.accept` accepts a pending connection attempt and returns a\n        tuple of a new `Connection` (the accepted client) and the address the\n        connection originated from.\n        '
    ctx = Context(TLSv1_METHOD)
    ctx.use_privatekey(load_privatekey(FILETYPE_PEM, server_key_pem))
    ctx.use_certificate(load_certificate(FILETYPE_PEM, server_cert_pem))
    port = socket_any_family()
    portSSL = Connection(ctx, port)
    portSSL.bind(('', 0))
    portSSL.listen(3)
    clientSSL = Connection(Context(TLSv1_METHOD), socket(port.family))
    clientSSL.connect((loopback_address(port), portSSL.getsockname()[1]))
    (serverSSL, address) = portSSL.accept()
    assert isinstance(serverSSL, Connection)
    assert (serverSSL.get_context() is ctx)
    assert (address == clientSSL.getsockname())
`Connection.accept` accepts a pending connection attempt and returns a
tuple of a new `Connection` (the accepted client) and the address the
connection originated from.
def test_accept(self):
    '\n        `Connection.accept` accepts a pending connection attempt and returns a\n        tuple of a new `Connection` (the accepted client) and the address the\n        connection originated from.\n        '
    ctx = Context(TLSv1_METHOD)
    ctx.use_privatekey(load_privatekey(FILETYPE_PEM, server_key_pem))
    ctx.use_certificate(load_certificate(FILETYPE_PEM, server_cert_pem))
    port = socket_any_family()
    portSSL = Connection(ctx, port)
    portSSL.bind((, 0))
    portSSL.listen(3)
    clientSSL = Connection(Context(TLSv1_METHOD), socket(port.family))
    clientSSL.connect((loopback_address(port), portSSL.getsockname()[1]))
    (serverSSL, address) = portSSL.accept()
    assert isinstance(serverSSL, Connection)
    assert (serverSSL.get_context() is ctx)
    assert (address == clientSSL.getsockname())