From 09252baa71819a967ade7370416e9bb9767f69d2 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 31 Aug 2011 14:31:20 -0700 Subject: Test publishing a single item. --- tests/test_stream_xep_0060.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py index e128eff5..048e41eb 100644 --- a/tests/test_stream_xep_0060.py +++ b/tests/test_stream_xep_0060.py @@ -3,6 +3,8 @@ import time import threading from sleekxmpp.test import * +from sleekxmpp.stanza.atom import AtomEntry +from sleekxmpp.xmlstream import register_stanza_plugin class TestStreamPubsub(SleekTest): @@ -381,12 +383,43 @@ class TestStreamPubsub(SleekTest): def testPublishSingle(self): """Test publishing a single item.""" - pass + payload = AtomEntry() + payload['title'] = 'Test' + + register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, AtomEntry) + + t = threading.Thread(name='publish_single', + target=self.xmpp['xep_0060'].publish, + args=('pubsub.example.com', 'somenode'), + kwargs={'item_id': 'ID42', + 'payload': payload}) + t.start() + + self.send(""" + + + + + + Test + + + + + + """) + + self.recv(""" + + """) + + t.join() + def testPublishSingleOptions(self): """Test publishing a single item, with options.""" - def testPublishMulti(self): """Test publishing multiple items.""" pass -- cgit v1.2.3