testinggtk r280 - trunk/tests/gobjecttests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r280 - trunk/tests/gobjecttests
- Date: Sat, 28 Jun 2008 10:38:36 +0000 (UTC)
Author: bjornl
Date: Sat Jun 28 10:38:36 2008
New Revision: 280
URL: http://svn.gnome.org/viewvc/testinggtk?rev=280&view=rev
Log:
Test for handler blocking by handler_id
Modified:
trunk/tests/gobjecttests/test_gobject.py
Modified: trunk/tests/gobjecttests/test_gobject.py
==============================================================================
--- trunk/tests/gobjecttests/test_gobject.py (original)
+++ trunk/tests/gobjecttests/test_gobject.py Sat Jun 28 10:38:36 2008
@@ -56,6 +56,24 @@
assert cb_prop_spec.name == 'prop'
assert cb_prop_spec.value_type == gobject.TYPE_INT
+def test_block_signal():
+ '''
+ Test blocking a signal by its ``handler_id``.
+ '''
+ emitted = [False]
+ def notify_cb(*args):
+ emitted[0] = True
+
+ class Sub47(gobject.GObject):
+ prop = gobject.property(type = int)
+ gobject.type_register(Sub47)
+ obj = Sub47()
+
+ handler_id = obj.connect('notify', notify_cb)
+ obj.handler_block(handler_id)
+ obj.set_property('prop', 99)
+ assert not emitted[0]
+
def test_is_freeze_cumulative():
obj = gobject.GObject()
for x in range(10):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]