Ignore:
Timestamp:
Aug 4, 2011, 9:38:24 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
wokkel-muc-client-support-24
Message:

Use descendants from wokkel.generic.Stanza in messages and presence.

  • Use wokkel.xmppim.AvailabilityPresence as a basis for presence stanzas.
  • Split wokkel.xmppim.PresenceProtocol and Base MUCClient on BasePresenceProtocol
  • Add new wokkel.xmppim.Message as the basis for message stanzas.
  • `receivedGroupChat
  • Change order of parameters for invite, as reason is optional.
  • Use datetimes everywhere where timestamps are needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r139 r141  
    55Tests for L{wokkel.muc}
    66"""
     7
     8from datetime import datetime
     9from dateutil.tz import tzutc
    710
    811from zope.interface import verify
     
    116119
    117120        def groupChat(room, user, message):
    118             self.assertEquals('test', message, "Wrong group chat message")
     121            self.assertEquals('test', message.body, "Wrong group chat message")
    119122            self.assertEquals(self.test_room, room.roomIdentifier,
    120123                              'Wrong room name')
     
    343346
    344347
    345         def historyReceived(room, user, body, stamp, frm=None):
    346             self.assertEquals('test', body, "wrong message body")
    347             self.assertTrue(stamp, 'Does not have a history stamp')
     348        def historyReceived(room, user, message):
     349            self.assertEquals('test', message.body, "wrong message body")
     350            stamp = datetime(2002, 10, 13, 23, 58, 37, tzinfo=tzutc())
     351            self.assertEquals(stamp, message.delay.stamp,
     352                             'Does not have a history stamp')
    348353
    349354        d, self.protocol.receivedHistory = calledAsync(historyReceived)
     
    365370        msg.addElement('thread', None, thread)
    366371
    367         archive.append({'stanza': msg, 'timestamp': '2002-10-13T23:58:37Z'})
     372        archive.append({'stanza': msg,
     373                        'timestamp': datetime(2002, 10, 13, 23, 58, 37,
     374                                              tzinfo=tzutc())})
    368375
    369376        msg = domish.Element((None, 'message'))
     
    373380        msg.addElement('thread', None, thread)
    374381
    375         archive.append({'stanza': msg, 'timestamp': '2002-10-13T23:58:43Z'})
     382        archive.append({'stanza': msg,
     383                        'timestamp': datetime(2002, 10, 13, 23, 58, 43,
     384                                              tzinfo=tzutc())})
    376385
    377386        self.protocol.history(self.room_jid, archive)
     
    392401        invitee = JID('test@jabber.org')
    393402
    394         self.protocol.invite(bareRoomJID, 'This is a test', invitee)
     403        self.protocol.invite(bareRoomJID, invitee, 'This is a test')
    395404
    396405        msg = self.stub.output[-1]
Note: See TracChangeset for help on using the changeset viewer.