summaryrefslogtreecommitdiff
path: root/sleekxmpp/test
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-04-26 16:32:58 -0400
committerLance Stout <lancestout@gmail.com>2011-04-26 16:32:58 -0400
commit5399fdd3a95377bfb5bba993f299664557cabb7c (patch)
tree4962c5a2326c85ef3bd600c5bea0503750113eea /sleekxmpp/test
parent016aac69f6328a2227e1770e78b44ae8e727b11a (diff)
downloadslixmpp-5399fdd3a95377bfb5bba993f299664557cabb7c.tar.gz
slixmpp-5399fdd3a95377bfb5bba993f299664557cabb7c.tar.bz2
slixmpp-5399fdd3a95377bfb5bba993f299664557cabb7c.tar.xz
slixmpp-5399fdd3a95377bfb5bba993f299664557cabb7c.zip
Add support for testing that no stanzas are sent in tests.
Use: self.send(None)
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r--sleekxmpp/test/sleektest.py5
1 files changed, 5 insertions, 0 deletions
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')