3 from __future__
import absolute_import
7 from gi
.repository
import GLib
12 class TestThread(unittest
.TestCase
):
14 self
.main
= GLib
.MainLoop()
17 def from_thread_cb(self
, test
, enum
):
18 assert test
== self
.obj
20 assert type(enum
) != int
22 GLib
.idle_add(self
.timeout_cb
)
25 self
.obj
= testhelper
.get_test_thread()
26 self
.obj
.connect('from-thread', self
.from_thread_cb
)
27 self
.obj
.emit('emit-signal')
29 def test_extension_module(self
):
30 GLib
.idle_add(self
.idle_cb
)
31 GLib
.timeout_add(2000, self
.timeout_cb
)
33 self
.assertTrue(self
.called
)