Ignore:
Timestamp:
Oct 20, 2008, 8:37:06 PM (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@114
Message:

add timeouts and a test for a user leaving a room

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r117 r118  
    205205       
    206206
     207    def test_userPartsRoom(self):
     208        """An entity leaves the room, a presence of type unavailable is received by the client.
     209        """
     210
     211        p = muc.UnavailableUserPresence()
     212        p['to'] = self.user_jid.full()
     213        p['from'] = self.room_jid.full()
     214
     215        # create a room
     216        self._createRoom()
     217        # add user to room
     218        u = muc.User(self.room_jid.resource)
     219
     220        room = self.protocol._getRoom(self.room_jid)
     221        room.addUser(u)
     222
     223        def userPresence(room, user):
     224            self.failUnless(room.name==self.test_room, 'Wrong room name')
     225            self.failUnless(room.inRoster(user)==False, 'User in roster')
     226                           
     227        d, self.protocol.userLeftRoom = calledAsync(userPresence)
     228        self.stub.send(p)
     229        return d
     230       
     231
    207232    def test_ban(self):
    208233        """Ban an entity in a room.
Note: See TracChangeset for help on using the changeset viewer.