diff options
author | mathieui <mathieui@mathieui.net> | 2019-08-21 21:19:10 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-12-27 15:27:28 +0100 |
commit | a83c00e933685bfaca57bee2f66d0b3eb8d2944a (patch) | |
tree | 4923c055a0e041f57d25b7bbcf2c5a55bdea8365 | |
parent | 31f6ef681401b7c54c07212ad2741f9eca324e48 (diff) | |
download | slixmpp-a83c00e933685bfaca57bee2f66d0b3eb8d2944a.tar.gz slixmpp-a83c00e933685bfaca57bee2f66d0b3eb8d2944a.tar.bz2 slixmpp-a83c00e933685bfaca57bee2f66d0b3eb8d2944a.tar.xz slixmpp-a83c00e933685bfaca57bee2f66d0b3eb8d2944a.zip |
Update test framework to work with new filters
(eewww)
-rw-r--r-- | slixmpp/test/slixtest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/slixmpp/test/slixtest.py b/slixmpp/test/slixtest.py index 802df73c..fbeff3c7 100644 --- a/slixmpp/test/slixtest.py +++ b/slixmpp/test/slixtest.py @@ -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. |