'Test the addition of a protocol handler after the stream
have been initialized.
Make sure that the handler will have the connected stream
passed via C{makeConnection} and have C{connectionInitialized}
called.'

def test_addHandlerInitialized(self):

    sm = self.streamManager
    xs = xmlstream.XmlStream(xmlstream.Authenticator())
    sm._connected(xs)
    sm._authd(xs)
    handler = DummyXMPPHandler()
    handler.setHandlerParent(sm)
    self.assertEqual(1, handler.doneMade)
    self.assertEqual(1, handler.doneInitialized)
    self.assertEqual(0, handler.doneLost)
