Beispiel #1
0
        def handler():
            nonlocal called
            called = True

            now = glib_loop.time()
            glib_loop.stop()

            assert now >= s + 1
Beispiel #2
0
        def handler():
            nonlocal called
            called = True

            now = glib_loop.time()
            glib_loop.stop()

            assert now >= s + 1
Beispiel #3
0
        def second():
            nonlocal passed
            assert glib_loop._running

            glib_loop.stop()

            assert glib_loop._running

            passed = True
Beispiel #4
0
        def second():
            nonlocal passed
            assert glib_loop._running

            glib_loop.stop()

            assert glib_loop._running

            passed = True
Beispiel #5
0
    def test_stop(self, glib_loop):
        with mock.patch.object(glib_loop, "_mainloop") as ml:
            glib_loop.stop()
            ml.quit.assert_any_call()

        glib_loop.set_application(Gio.Application())

        with mock.patch.object(glib_loop, "_application") as app:
            glib_loop.stop()
            app.quit.assert_any_call()
Beispiel #6
0
    def test_stop(self, glib_loop):
        with mock.patch.object(glib_loop, '_mainloop') as ml:
            glib_loop.stop()
            ml.quit.assert_any_call()

        glib_loop.set_application(Gio.Application())

        with mock.patch.object(glib_loop, '_application') as app:
            glib_loop.stop()
            app.quit.assert_any_call()
Beispiel #7
0
        def handler():
            nonlocal called
            called = True

            now = glib_loop.time()
            glib_loop.stop()

            print(now, s)

            assert now - s <= 0.2
Beispiel #8
0
        def handler():
            nonlocal called
            called = True

            now = glib_loop.time()
            glib_loop.stop()

            print(now, s)
            import math

            assert math.isclose(now, s, abs_tol=0.1)
Beispiel #9
0
 def handler():
     nonlocal called
     called = True
     glib_loop.stop()
Beispiel #10
0
 def callback(*args):
     nonlocal called
     called = True
     glib_loop.stop()
Beispiel #11
0
 def timeout():
     nonlocal timeout_occurred
     timeout_occurred = True
     glib_loop.stop()
Beispiel #12
0
        def callback():
            nonlocal i
            i += 1

            if i == expected_i:
                glib_loop.stop()
Beispiel #13
0
 def callback(*args):
     nonlocal called
     called = True
     glib_loop.stop()
Beispiel #14
0
 def handler():
     nonlocal called
     called = True
     glib_loop.stop()
Beispiel #15
0
        def remover(fd):
            nonlocal removed
            assert glib_loop.remove_writer(fd)

            removed = True
            glib_loop.stop()
Beispiel #16
0
 def timeout():
     nonlocal timeout_occurred
     timeout_occurred = True
     glib_loop.stop()
Beispiel #17
0
        def callback():
            nonlocal i
            i += 1

            if i == expected_i:
                glib_loop.stop()
Beispiel #18
0
        def remover(fd):
            nonlocal removed
            assert glib_loop.remove_writer(fd)

            removed = True
            glib_loop.stop()