Changeset 142:078a14ca2b3e


Ignore:
Timestamp:
Aug 4, 2011, 9:39:19 PM (9 years ago)
Author:
Goffi <goffi@…>
Branch:
wokkel-muc-client-support-24
Message:

Add test for messages received from the room itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r141 r142  
    128128
    129129
     130    def test_groupChatNoNick(self):
     131        """
     132        Message received from the room itself, no nickname
     133        """
     134        xml = """
     135            <message to='test@test.com' from='%s' type='groupchat'>
     136              <body>test</body>
     137            </message>
     138        """ % (self.room_jid.userhost())
     139
     140        self._createRoom()
     141
     142        def groupChat(room, user, message):
     143            self.assertEquals('test', message.body,
     144                              "Wrong group chat message")
     145            self.assertEquals(self.test_room, room.roomIdentifier,
     146                              'Wrong room name')
     147
     148
     149        d, self.protocol.receivedGroupChat = calledAsync(groupChat)
     150        self.stub.send(parseXml(xml))
     151        return d
     152
     153
    130154    def test_joinRoom(self):
    131155        """
Note: See TracChangeset for help on using the changeset viewer.