testinggtk r404 - trunk/tests



Author: bjornl
Date: Mon Sep  8 02:18:13 2008
New Revision: 404
URL: http://svn.gnome.org/viewvc/testinggtk?rev=404&view=rev

Log:
New testing testing gtk.Widget's default realize handler

Modified:
   trunk/tests/test_widget.py

Modified: trunk/tests/test_widget.py
==============================================================================
--- trunk/tests/test_widget.py	(original)
+++ trunk/tests/test_widget.py	Mon Sep  8 02:18:13 2008
@@ -2,6 +2,7 @@
 Tests for the ``gtk.Widget`` class. Since that class is abstract,
 subclasses of it is used in these tests.
 '''
+import gobject
 import gtk
 import utils
 
@@ -193,17 +194,37 @@
     widget = gtk.Button()
     widget.map()
 
+ utils pass_on_warnings
 def test_map_visible_widget():
     '''
     Ensure that mapping a visible unrealized widget fails with a
     warning message.
 
-    :bug: TBD
+    :bug: #551303
     '''
     widget = gtk.Button('hi')
     widget.set_flags(gtk.VISIBLE)
     widget.map()
 
+ utils pass_on_warnings
+def test_realize_no_window_widget():
+    '''
+    In this test a ``gtk.NO_WINDOW`` ``gtk.Widget`` that does not
+    implement the realized signal handler is realized. A warning
+    message should be printed.
+    '''
+    class Test586(gtk.Widget):
+        def __init__(self):
+            super(Test586, self).__init__()
+    gobject.type_register(Test586)
+
+    t = Test586()
+    t.unset_flags(gtk.NO_WINDOW)
+    win = gtk.Window()
+    win.add(t)
+    t.realize()
+
+
 ######################################################################
 ##### Focus and grab tests ###########################################
 ######################################################################



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