'Set up a stream, and act as if resource binding succeeds.'

def testBasic(self):

    def onBind(iq):
        response = xmlstream.toResponse(iq, 'result')
        response.addElement((NS_BIND, 'bind'))
        response.bind.addElement('jid', content=u'user@example.com/other    resource')
        self.pipe.source.send(response)
    def cb(result):
        self.assertEqual(jid.JID('user@example.com/other    resource'), self.authenticator.jid)
    d1 = self.waitFor(IQ_BIND_SET, onBind)
    d2 = self.init.start()
    d2.addCallback(cb)
    return defer.gatherResults([d1, d2])
