testinggtk r336 - trunk/tests



Author: bjornl
Date: Wed Jul  2 20:42:05 2008
New Revision: 336
URL: http://svn.gnome.org/viewvc/testinggtk?rev=336&view=rev

Log:
Test for popup method

Modified:
   trunk/tests/test_menu.py

Modified: trunk/tests/test_menu.py
==============================================================================
--- trunk/tests/test_menu.py	(original)
+++ trunk/tests/test_menu.py	Wed Jul  2 20:42:05 2008
@@ -2,6 +2,7 @@
 Tests for the ``gtk.Menu`` class.
 '''
 import gtk
+from gtk import gdk
 import utils
 
 def test_default_attributes():
@@ -56,3 +57,12 @@
     '''
     menu = gtk.Menu()
     menu.add(gtk.Label('hi'))
+
+def test_popup():
+    '''
+    Ensure that ``popup`` shows and grabs the menu widget.
+    '''
+    menu = gtk.Menu()
+    menu.popup(None, None, None, gdk.BUTTON_PRESS, 0, 0)
+    assert gtk.grab_get_current() == menu
+    assert menu.flags() & gtk.VISIBLE



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