':py:obj:`Connection.accept` accepts a pending connection attempt and returns a
tuple of a new :py:obj:`Connection` (the accepted client) and the address the
connection originated from.'

def test_accept(self):

    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()
    portSSL = Connection(ctx, port)
    portSSL.bind(('', 0))
    portSSL.listen(3)
    clientSSL = Connection(Context(TLSv1_METHOD), socket())
    clientSSL.connect(('127.0.0.1', portSSL.getsockname()[1]))
    (serverSSL, address) = portSSL.accept()
    self.assertTrue(isinstance(serverSSL, Connection))
    self.assertIdentical(serverSSL.get_context(), ctx)
    self.assertEquals(address, clientSSL.getsockname())
