'Receiving a handshake matching the secret authenticates the stream.'

def test_onHandshake(self):

    authd = []
    def authenticated(xs):
        authd.append(xs)
    xs = self.xmlstream
    xs.addOnetimeObserver(xmlstream.STREAM_AUTHD_EVENT, authenticated)
    xs.sid = u'1234'
    theHash = '32532c0f7dbf1253c095b18b18e36d38d94c1256'
    xs.authenticator.onHandshake(theHash)
    self.assertEqual('<handshake/>', self.output[(-1)])
    self.assertEqual(1, len(authd))
