def first(): assert glib_loop._running glib_loop.call_soon(second) glib_loop.run() assert glib_loop._running
def test_run_recursion(self, glib_loop): passed = False def first(): assert glib_loop._running glib_loop.call_soon(second) glib_loop.run() assert glib_loop._running def second(): nonlocal passed assert glib_loop._running glib_loop.stop() assert glib_loop._running passed = True assert not glib_loop._running glib_loop.call_soon(first) glib_loop.run() assert not glib_loop._running assert passed
def test_run(self, glib_loop): with mock.patch.object(glib_loop, '_mainloop') as ml: glib_loop.run() ml.run.assert_any_call() glib_loop.set_application(Gio.Application()) with mock.patch.object(glib_loop, '_application') as app: glib_loop.run() app.run.assert_any_call(None)
def test_run(self, glib_loop): with mock.patch.object(glib_loop, "_mainloop") as ml: glib_loop.run() ml.run.assert_any_call() glib_loop.set_application(Gio.Application()) with mock.patch.object(glib_loop, "_application") as app: glib_loop.run() app.run.assert_any_call(None)