'The completion of the TLS handshake calls C{handshakeCompleted} on
L{Protocol} objects that provide L{IHandshakeListener}.  At the time
C{handshakeCompleted} is invoked, the transport\'s peer certificate will
have been initialized.'

def test_handshakeNotification(self):

    (client, server, pump) = handshakingClientAndServer()
    self.assertEqual(client.wrappedProtocol.handshook, False)
    self.assertEqual(server.wrappedProtocol.handshaked, False)
    pump.flush()
    self.assertEqual(client.wrappedProtocol.handshook, True)
    self.assertEqual(server.wrappedProtocol.handshaked, True)
    self.assertIsNot(client.wrappedProtocol.peerAfterHandshake, None)
