testinggtk r306 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r306 - trunk/tests
- Date: Sat, 28 Jun 2008 22:44:55 +0000 (UTC)
Author: bjornl
Date: Sat Jun 28 22:44:55 2008
New Revision: 306
URL: http://svn.gnome.org/viewvc/testinggtk?rev=306&view=rev
Log:
Test for add-widget signal
Modified:
trunk/tests/test_uimanager.py
Modified: trunk/tests/test_uimanager.py
==============================================================================
--- trunk/tests/test_uimanager.py (original)
+++ trunk/tests/test_uimanager.py Sat Jun 28 22:44:55 2008
@@ -159,3 +159,23 @@
label = children[1].get_child()
# I don't know i18n :)
assert label.get_text() == 'Tom'
+
+def test_add_widget_signal():
+ '''
+ Ensure that the ``add-widget`` signal is emitted when
+ ``get_widget`` is called.
+ '''
+ xml = '''
+ <ui>
+ <menubar/>
+ </ui>
+ '''
+ data = []
+ def add_widget_cb(uimanager, widget):
+ data.append((uimanager, widget))
+ ui = gtk.UIManager()
+ ui.connect('add-widget', add_widget_cb)
+ ui.add_ui_from_string(xml)
+ menubar = ui.get_widget('/ui/menubar')
+ assert data[0][0] == ui
+ assert data[0][1] == menubar
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]