testinggtk r211 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r211 - trunk/tests
- Date: Sat, 21 Jun 2008 19:00:23 +0000 (UTC)
Author: bjornl
Date: Sat Jun 21 19:00:23 2008
New Revision: 211
URL: http://svn.gnome.org/viewvc/testinggtk?rev=211&view=rev
Log:
Tests for appending and the active attribute
Modified:
trunk/tests/test_menu.py
Modified: trunk/tests/test_menu.py
==============================================================================
--- trunk/tests/test_menu.py (original)
+++ trunk/tests/test_menu.py Sat Jun 21 19:00:23 2008
@@ -10,3 +10,22 @@
assert not menu.get_attach_widget()
assert not menu.get_tearoff_state()
assert not menu.get_title()
+
+def test_appending_menu_items():
+ menu = gtk.Menu()
+ menu.append(gtk.MenuItem())
+ menu.append(gtk.MenuItem())
+ assert len(menu.get_children()) == 2
+
+def test_set_get_active():
+ menu = gtk.Menu()
+
+ items = [gtk.MenuItem(label = 'hi') for x in range(10)]
+ for item in items:
+ menu.append(item)
+
+ for idx, item in enumerate(items):
+ print idx, item
+ menu.set_active(idx)
+ print menu.get_active()
+ assert menu.get_active() == item
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]