diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-09-28 09:31:44 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-09-28 09:31:44 +0000 |
commit | 21662fcf8ec7fc42ae3e6c53c46abab8a09b5012 (patch) | |
tree | d691f36fba5e855fc34169abf571dede434aa639 /tests | |
parent | f993117ea1ac89299b70a8f2e902823032b03d78 (diff) | |
download | pygtk-21662fcf8ec7fc42ae3e6c53c46abab8a09b5012.tar.gz |
Forgot to commit this yesterday
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_thread.py | 24 |
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() |