summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_thread.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_thread.py b/tests/test_thread.py
new file mode 100644
index 00000000..a40b99f7
--- /dev/null
+++ b/tests/test_thread.py
@@ -0,0 +1,24 @@
+import unittest
+
+from common import gobject, gtk, testhelper
+
+gobject.threads_init()
+
+class TestThread(unittest.TestCase):
+ def from_thread_cb(self, test, enum):
+ assert test == self.obj
+ assert int(enum) == 0
+ assert type(enum) != int
+
+ def idle_cb(self):
+ self.obj = testhelper.get_test_thread()
+ self.obj.connect('from-thread', self.from_thread_cb)
+ self.obj.emit('emit-signal')
+
+ def testExtensionModule(self):
+ gtk.idle_add(self.idle_cb)
+ gtk.timeout_add(50, self.timeout_cb)
+ gtk.main()
+
+ def timeout_cb(self):
+ gtk.main_quit()