testinggtk r331 - trunk/tests



Author: bjornl
Date: Tue Jul  1 19:24:08 2008
New Revision: 331
URL: http://svn.gnome.org/viewvc/testinggtk?rev=331&view=rev

Log:
Two tests for property notify signals

Modified:
   trunk/tests/test_action.py

Modified: trunk/tests/test_action.py
==============================================================================
--- trunk/tests/test_action.py	(original)
+++ trunk/tests/test_action.py	Tue Jul  1 19:24:08 2008
@@ -115,4 +115,29 @@
     assert not action.get_property('hide-if-empty')
     action.set_property('hide-if-empty', True)
     assert action.get_property('hide-if-empty')
-    
+
+def test_notify_emitted_on_hide_if_empty():
+    '''
+    Ensure that a notify signal is emitted when the ``hide-if-empty``
+    property is changed.
+    '''
+    changed_param = []
+    def notify_cb(action, param):
+        changed_param.append(param)
+    action = gtk.Action('name', 'label', 'tooltip', None)
+    action.connect('notify', notify_cb)
+    action.set_property('hide-if-empty', False)
+    assert changed_param[0].name == 'hide-if-empty'
+
+def test_notify_emitted_on_visible_overflown():
+    '''
+    Ensure that a correct notify signal is emitted when the
+    ``visible-overflown`` property is changed.
+    '''
+    changed_param = []
+    def notify_cb(action, param):
+        changed_param.append(param)
+    action = gtk.Action('name', 'label', 'tooltip', None)
+    action.connect('notify', notify_cb)
+    action.set_property('visible-overflown', False)
+    assert changed_param[0].name == 'visible-overflown'



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]