linux: Add wait_for_mainloop() test helper

This commit is contained in:
Bastien Nocera 2023-07-05 12:25:57 +02:00
parent faa5a560f9
commit 4d3d8759db

View file

@ -324,6 +324,11 @@ class Tests(dbusmock.DBusTestCase):
else:
self.fail(message or 'timed out waiting for ' + str(condition))
def wait_for_mainloop(self):
ml = GLib.MainLoop()
GLib.timeout_add(100, ml.quit)
ml.run()
#
# Actual test cases
#