From a83c00e933685bfaca57bee2f66d0b3eb8d2944a Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 21 Aug 2019 21:19:10 +0200 Subject: Update test framework to work with new filters (eewww) --- slixmpp/test/slixtest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- cgit v1.2.3