mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Add support for testing that no stanzas are sent in tests.
Use: self.send(None)
This commit is contained in:
parent
016aac69f6
commit
5399fdd3a9
1 changed files with 5 additions and 0 deletions
|
@ -600,8 +600,13 @@ class SleekTest(unittest.TestCase):
|
||||||
Defaults to the value of self.match_method.
|
Defaults to the value of self.match_method.
|
||||||
"""
|
"""
|
||||||
sent = self.xmpp.socket.next_sent(timeout)
|
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:
|
if sent is None:
|
||||||
self.fail("No stanza was sent.")
|
self.fail("No stanza was sent.")
|
||||||
|
|
||||||
xml = self.parse_xml(sent)
|
xml = self.parse_xml(sent)
|
||||||
self.fix_namespaces(xml, 'jabber:client')
|
self.fix_namespaces(xml, 'jabber:client')
|
||||||
sent = self.xmpp._build_stanza(xml, 'jabber:client')
|
sent = self.xmpp._build_stanza(xml, 'jabber:client')
|
||||||
|
|
Loading…
Reference in a new issue