testinggtk r279 - trunk/tests/gobjecttests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r279 - trunk/tests/gobjecttests
- Date: Sat, 28 Jun 2008 10:35:02 +0000 (UTC)
Author: bjornl
Date: Sat Jun 28 10:35:02 2008
New Revision: 279
URL: http://svn.gnome.org/viewvc/testinggtk?rev=279&view=rev
Log:
Test for connecting to the notify signal
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:35:02 2008
@@ -34,6 +34,28 @@
obj = gobject.GObject()
obj.handler_block(123)
+def test_notify_signal():
+ '''
+ Ensure that the ``notify`` signal is emitted properly when a
+ property is being modified.
+ '''
+ class Sub46(gobject.GObject):
+ prop = gobject.property(type = int)
+ gobject.type_register(Sub46)
+
+ cb_args = []
+ def notify_cb(obj, prop_spec):
+ cb_args.append((obj, prop_spec))
+
+ obj = Sub46()
+ obj.connect('notify', notify_cb)
+ obj.set_property('prop', 99)
+
+ cb_obj, cb_prop_spec = cb_args[0]
+ assert cb_obj == obj
+ assert cb_prop_spec.name == 'prop'
+ assert cb_prop_spec.value_type == gobject.TYPE_INT
+
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]