Ignore:
Timestamp:
Oct 21, 2008, 12:57:32 AM (14 years ago)
Author:
Christopher Zorn <tofu@…>
Branch:
wokkel-muc-client-support-24
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/branches/wokkel-muc-client-support-24@122
Message:

make sure we change status and add a test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r125 r126  
    479479
    480480        """
    481         give_voice = JID('ban@jabber.org/TroubleMakger')
     481        give_voice = JID('voice@jabber.org/TroubleMakger')
    482482        def cb(give_voice):
    483483            self.failUnless(give_voice, 'Did not give voice user')
     
    497497        return d
    498498
    499        
     499
     500    def test_changeStatus(self):
     501        """Change status
     502        """
     503        self._createRoom()
     504        r = self.protocol._getRoom(self.room_jid)
     505        u = muc.User(self.room_jid.resource)
     506        r.addUser(u)
     507
     508        def cb(room):
     509            self.assertEquals(self.test_room, room.name)
     510            u = room.getUser(self.room_jid.resource)
     511            self.failUnless(u is not None, 'User not found')
     512            self.failUnless(u.status == 'testing MUC', 'Wrong status')
     513            self.failUnless(u.show == 'xa', 'Wrong show')
     514           
     515        d = self.protocol.status(self.room_jid, 'xa', 'testing MUC')
     516        d.addCallback(cb)
     517
     518        prs = self.stub.output[-1]
     519
     520        self.failUnless(prs.name=='presence', "Need to be presence")
     521        self.failUnless(getattr(prs, 'x', None), 'No muc x element')
     522
     523        # send back user presence, they joined       
     524        response = muc.UserPresence(frm=self.room_jid.full())
     525        response.addElement('show', None, 'xa')
     526        response.addElement('status', None, 'testing MUC')
     527        self.stub.send(response)
     528        return d       
Note: See TracChangeset for help on using the changeset viewer.