From 016aac69f6328a2227e1770e78b44ae8e727b11a Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Thu, 14 Apr 2011 17:34:33 -0700 Subject: [PATCH 1/2] Pubsub/Unsubscribe was not getting registered --- sleekxmpp/plugins/stanza_pubsub.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py index 2d809a35..b5964537 100644 --- a/sleekxmpp/plugins/stanza_pubsub.py +++ b/sleekxmpp/plugins/stanza_pubsub.py @@ -237,6 +237,8 @@ class Unsubscribe(ElementBase): def getJid(self): return JID(self._getAttr('jid')) +registerStanzaPlugin(Pubsub, Unsubscribe) + class Subscribe(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' name = 'subscribe' From 5399fdd3a95377bfb5bba993f299664557cabb7c Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 26 Apr 2011 16:32:58 -0400 Subject: [PATCH 2/2] Add support for testing that no stanzas are sent in tests. Use: self.send(None) --- sleekxmpp/test/sleektest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py index c5f48895..fd47a87e 100644 --- a/sleekxmpp/test/sleektest.py +++ b/sleekxmpp/test/sleektest.py @@ -600,8 +600,13 @@ class SleekTest(unittest.TestCase): Defaults to the value of self.match_method. """ sent = self.xmpp.socket.next_sent(timeout) + if data is None and sent is None: + return + if data is None and sent is not None: + self.fail("Stanza data was sent: %s" % sent) if sent is None: self.fail("No stanza was sent.") + xml = self.parse_xml(sent) self.fix_namespaces(xml, 'jabber:client') sent = self.xmpp._build_stanza(xml, 'jabber:client')