testinggtk r124 - trunk/tests



Author: bjornl
Date: Sat Jun 14 21:51:50 2008
New Revision: 124
URL: http://svn.gnome.org/viewvc/testinggtk?rev=124&view=rev

Log:
Tests for the gtk.MenuBar class

Added:
   trunk/tests/test_menubar.py

Added: trunk/tests/test_menubar.py
==============================================================================
--- (empty file)
+++ trunk/tests/test_menubar.py	Sat Jun 14 21:51:50 2008
@@ -0,0 +1,32 @@
+'''
+Tests for the ``gtk.MenuBar`` class.
+'''
+import gtk
+import utils
+
+def test_default_attributes():
+    menubar = gtk.MenuBar()
+    assert menubar.get_pack_direction() == gtk.PACK_DIRECTION_LTR
+    assert menubar.get_child_pack_direction() == gtk.PACK_DIRECTION_LTR
+    assert len(menubar.get_children()) == 0
+
+def test_append_none():
+    '''
+    Ensure that a ``TypeError`` is raised if ``None`` is appended to a
+    ``gtk.MenuBar``.
+    '''
+    menubar = gtk.MenuBar()
+    try:
+        menubar.append(None)
+        assert False
+    except TypeError:
+        assert True
+
+ utils pass_on_warnings        
+def test_append_not_menuitem():
+    '''
+    Ensure that a GtkWarning is displayed if a non-menuitem is
+    appended to a ``gtk.MenuBar``.
+    '''
+    menubar = gtk.MenuBar()
+    menubar.append(gtk.Label())



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