Example #1
0
    def test_remove_writer(self, glib_loop):
        import os
        rfd, wfd = os.pipe()

        f = os.fdopen(wfd, 'r')

        glib_loop.add_writer(f, None)

        os.close(rfd)
        os.close(wfd)

        assert glib_loop.remove_writer(f)
        assert not glib_loop.remove_writer(f.fileno())
Example #2
0
    def test_remove_writer(self, glib_loop):
        import os
        rfd, wfd = os.pipe()

        f = os.fdopen(wfd, 'r')

        os.close(rfd)
        os.close(wfd)

        glib_loop.add_writer(f, None)

        assert glib_loop.remove_writer(f)
        assert not glib_loop.remove_writer(f.fileno())
Example #3
0
        def remover(fd):
            nonlocal removed
            assert glib_loop.remove_writer(fd)

            removed = True
            glib_loop.stop()
Example #4
0
        def remover(fd):
            nonlocal removed
            assert glib_loop.remove_writer(fd)

            removed = True
            glib_loop.stop()