'Test send when the stream is connected but not yet initialized.
The data should be cached until the XML stream has been initialized.'

def test_sendNotInitialized(self):

    factory = xmlstream.XmlStreamFactory(xmlstream.Authenticator())
    sm = xmlstream.StreamManager(factory)
    xs = factory.buildProtocol(None)
    xs.transport = proto_helpers.StringTransport()
    xs.connectionMade()
    xs.dataReceived("<stream:stream    xmlns='jabber:client'    xmlns:stream='http://etherx.jabber.org/streams'    from='example.com'    id='12345'>")
    sm.send('<presence/>')
    self.assertEqual('', xs.transport.value())
    self.assertEqual('<presence/>', sm._packetQueue[0])
