Update test framework to work with new filters
(eewww)
This commit is contained in:
parent
31f6ef6814
commit
a83c00e933
1 changed files with 10 additions and 0 deletions
|
@ -352,6 +352,7 @@ class SlixTest(unittest.TestCase):
|
|||
header = self.xmpp.stream_header
|
||||
|
||||
self.xmpp.data_received(header)
|
||||
self.wait_for_send_queue()
|
||||
|
||||
if skip:
|
||||
self.xmpp.socket.next_sent()
|
||||
|
@ -599,6 +600,7 @@ class SlixTest(unittest.TestCase):
|
|||
'id', 'stanzapath', 'xpath', and 'mask'.
|
||||
Defaults to the value of self.match_method.
|
||||
"""
|
||||
self.wait_for_send_queue()
|
||||
sent = self.xmpp.socket.next_sent(timeout)
|
||||
if data is None and sent is None:
|
||||
return
|
||||
|
@ -615,6 +617,14 @@ class SlixTest(unittest.TestCase):
|
|||
defaults=defaults,
|
||||
use_values=use_values)
|
||||
|
||||
def wait_for_send_queue(self):
|
||||
loop = asyncio.get_event_loop()
|
||||
future = asyncio.ensure_future(self.xmpp.run_filters(), loop=loop)
|
||||
queue = self.xmpp.waiting_queue
|
||||
print(queue)
|
||||
loop.run_until_complete(queue.join())
|
||||
future.cancel()
|
||||
|
||||
def stream_close(self):
|
||||
"""
|
||||
Disconnect the dummy XMPP client.
|
||||
|
|
Loading…
Reference in a new issue