def test_leave(self):
        def joined(_):
            return self.protocol.leave(self.roomJID)

        def left(_):
            self.assertIdentical(None, self.protocol._getRoom(self.roomJID))

        # Join the room
        d = self.protocol.join(self.roomJID, self.nick)
        d.addCallback(joined)
        d.addCallback(left)

        # Receive presence back from the room: joined.
        xml = u"""
            <presence to='%s' from='%s'/>
        """ % (self.userJID, self.occupantJID)
        self.stub.send(parseXml(xml))

        # Receive presence back from the room: left.
        xml = u"""
            <presence to='%s' from='%s' type='unavailable'/>
        """ % (self.userJID, self.occupantJID)
        self.stub.send(parseXml(xml))

        return d
Client leaves a room
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_muc.py/MUCClientTest.test_leave