def test_status(self):
        def joined(_):
            d = self.protocol.status(self.roomJID, 'xa', 'testing MUC')
            d.addCallback(statusChanged)
            return d

        def statusChanged(presence):
            self.assertEqual(self.occupantJID, presence.sender)

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

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

        # The presence for the status change should have been sent now.
        element = self.stub.output[-1]

        self.assertEquals('presence', element.name, "Need to be presence")
        self.assertTrue(getattr(element, 'x', None), 'No muc x element')

        # send back user presence, status changed
        xml = u"""
            <presence from='%s'>
              <x xmlns='http://jabber.org/protocol/muc#user'>
                <item affiliation='member' role='participant'/>
              </x>
              <show>xa</show>
              <status>testing MUC</status>
            </presence>
        """ % self.occupantJID
        self.stub.send(parseXml(xml))

        return d
Change status
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_muc.py/MUCClientProtocolTest.test_status