Ignore:
Timestamp:
Jul 7, 2008, 4:39:05 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@57
Message:

Implement SHIM support.

Author: ralphm.
Fixes #14.

This changes the signature of PubSubClient's itemsReceived and friends, to
have an object to represent the event, for easier addition of new information
from the event's message stanza, like these SHIM headers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_pubsub.py

    r25 r27  
    8080        item3['id'] = 'item3'
    8181
    82         def itemsReceived(recipient, service, nodeIdentifier, items):
    83             self.assertEquals(JID('user@example.org/home'), recipient)
    84             self.assertEquals(JID('pubsub.example.org'), service)
    85             self.assertEquals('test', nodeIdentifier)
    86             self.assertEquals([item1, item2, item3], items)
     82        def itemsReceived(event):
     83            self.assertEquals(JID('user@example.org/home'), event.recipient)
     84            self.assertEquals(JID('pubsub.example.org'), event.sender)
     85            self.assertEquals('test', event.nodeIdentifier)
     86            self.assertEquals([item1, item2, item3], event.items)
    8787
    8888        d, self.protocol.itemsReceived = calledAsync(itemsReceived)
     
    102102        items['node'] = 'test'
    103103
    104         def deleteReceived(recipient, service, nodeIdentifier):
    105             self.assertEquals(JID('user@example.org/home'), recipient)
    106             self.assertEquals(JID('pubsub.example.org'), service)
    107             self.assertEquals('test', nodeIdentifier)
     104        def deleteReceived(event):
     105            self.assertEquals(JID('user@example.org/home'), event.recipient)
     106            self.assertEquals(JID('pubsub.example.org'), event.sender)
     107            self.assertEquals('test', event.nodeIdentifier)
    108108
    109109        d, self.protocol.deleteReceived = calledAsync(deleteReceived)
     
    123123        items['node'] = 'test'
    124124
    125         def purgeReceived(recipient, service, nodeIdentifier):
    126             self.assertEquals(JID('user@example.org/home'), recipient)
    127             self.assertEquals(JID('pubsub.example.org'), service)
    128             self.assertEquals('test', nodeIdentifier)
     125        def purgeReceived(event):
     126            self.assertEquals(JID('user@example.org/home'), event.recipient)
     127            self.assertEquals(JID('pubsub.example.org'), event.sender)
     128            self.assertEquals('test', event.nodeIdentifier)
    129129
    130130        d, self.protocol.purgeReceived = calledAsync(purgeReceived)
Note: See TracChangeset for help on using the changeset viewer.