From 46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 31 Aug 2011 14:55:37 -0700 Subject: Test publishng an item with options. --- tests/test_stream_xep_0060.py | 51 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'tests/test_stream_xep_0060.py') diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py index 048e41eb..9feb629c 100644 --- a/tests/test_stream_xep_0060.py +++ b/tests/test_stream_xep_0060.py @@ -416,9 +416,58 @@ class TestStreamPubsub(SleekTest): t.join() - def testPublishSingleOptions(self): """Test publishing a single item, with options.""" + payload = AtomEntry() + payload['title'] = 'Test' + + register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, AtomEntry) + + options = self.xmpp['xep_0004'].make_form() + options.add_field(var='FORM_TYPE', ftype='hidden', + value='http://jabber.org/protocol/pubsub#publish-options') + options.add_field(var='pubsub#access_model', ftype='text-single', + value='presence') + options['type'] = 'submit' + + t = threading.Thread(name='publish_single', + target=self.xmpp['xep_0060'].publish, + args=('pubsub.example.com', 'somenode'), + kwargs={'item_id': 'ID42', + 'payload': payload, + 'options': options}) + t.start() + + self.send(""" + + + + + + Test + + + + + + + http://jabber.org/protocol/pubsub#publish-options + + + presence + + + + + + """, use_values=False) + + self.recv(""" + + """) + + t.join() def testPublishMulti(self): """Test publishing multiple items.""" -- cgit v1.2.3