testinggtk r360 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r360 - trunk/tests
- Date: Mon, 4 Aug 2008 20:49:47 +0000 (UTC)
Author: bjornl
Date: Mon Aug 4 20:49:47 2008
New Revision: 360
URL: http://svn.gnome.org/viewvc/testinggtk?rev=360&view=rev
Log:
New test checking which widgets are returned by gtk.ImageMenuItem.foreach
Modified:
trunk/tests/test_imagemenuitem.py
Modified: trunk/tests/test_imagemenuitem.py
==============================================================================
--- trunk/tests/test_imagemenuitem.py (original)
+++ trunk/tests/test_imagemenuitem.py Mon Aug 4 20:49:47 2008
@@ -41,10 +41,24 @@
item = gtk.ImageMenuItem("Label text")
item.set_image(gtk.Image())
item.forall(forall_cb)
+ assert len(forall_widgets) == 2
assert isinstance(forall_widgets[0], gtk.Label)
assert isinstance(forall_widgets[1], gtk.Image)
-
-
-
-
+
+def test_foreach_with_container_child():
+ '''
+ Ensure that ``foreach`` only finds one children of the
+ ``gtk.ImageMenuItem``. The ``gtk.Image`` set with ``set_image`` is
+ an internal child.
+
+ :bug: #534979
+ '''
+ foreach_widgets = []
+ def foreach_cb(widget):
+ foreach_widgets.append(widget)
+ item = gtk.ImageMenuItem("Label text")
+ item.set_image(gtk.Image())
+ item.foreach(foreach_cb)
+ assert len(foreach_widgets) == 1
+ assert isinstance(foreach_widgets[0], gtk.Label)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]