Changeset 92:f69b08281bec for wokkel/test/test_pubsub.py
- Timestamp:
- Feb 12, 2011, 12:08:30 AM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wokkel/test/test_pubsub.py
r90 r92 1 # Copyright (c) 2003-201 0Ralph Meijer1 # Copyright (c) 2003-2011 Ralph Meijer 2 2 # See LICENSE for details. 3 3 … … 1057 1057 1058 1058 1059 def test_fromElementPublishItemsOptions(self): 1060 """ 1061 Test parsing a publish request with items and options. 1062 1063 Note that publishing options are not supported, but passing them 1064 shouldn't affect processing of the publish request itself. 1065 """ 1066 1067 xml = """ 1068 <iq type='set' to='pubsub.example.org' 1069 from='user@example.org'> 1070 <pubsub xmlns='http://jabber.org/protocol/pubsub'> 1071 <publish node='test'> 1072 <item id="item1"/> 1073 <item id="item2"/> 1074 </publish> 1075 <publish-options/> 1076 </pubsub> 1077 </iq> 1078 """ 1079 1080 request = pubsub.PubSubRequest.fromElement(parseXml(xml)) 1081 self.assertEqual(2, len(request.items)) 1082 self.assertEqual(u'item1', request.items[0]["id"]) 1083 self.assertEqual(u'item2', request.items[1]["id"]) 1084 1059 1085 def test_fromElementPublishNoNode(self): 1060 1086 """ … … 1546 1572 request = pubsub.PubSubRequest.fromElement(parseXml(xml)) 1547 1573 self.assertEqual({}, request.options.getValues()) 1574 self.assertEqual(u'mynode', request.nodeIdentifier) 1548 1575 1549 1576 … … 1568 1595 request = pubsub.PubSubRequest.fromElement(parseXml(xml)) 1569 1596 self.assertEqual({}, request.options.getValues()) 1597 self.assertEqual(u'mynode', request.nodeIdentifier) 1570 1598 1571 1599 … … 2286 2314 2287 2315 2288 def test_on_unsubscribe (self):2316 def test_on_unsubscribeSubscriptionIdentifier(self): 2289 2317 """ 2290 2318 A successful unsubscription with subid should return an empty response.
Note: See TracChangeset
for help on using the changeset viewer.