testinggtk r310 - trunk/tests



Author: bjornl
Date: Sun Jun 29 03:34:08 2008
New Revision: 310
URL: http://svn.gnome.org/viewvc/testinggtk?rev=310&view=rev

Log:
Simple test for gtk.window_list_toplevels

Modified:
   trunk/tests/test_window.py

Modified: trunk/tests/test_window.py
==============================================================================
--- trunk/tests/test_window.py	(original)
+++ trunk/tests/test_window.py	Sun Jun 29 03:34:08 2008
@@ -66,4 +66,17 @@
     assert win.get_focus() == button
     win.set_focus(None)
     assert not win.get_focus()
-    
+
+def test_list_toplevels():
+    '''
+    Ensure that all active ``gtk.Window`` widgets are listed in
+    ``gtk.window_list_toplevels``.
+    '''
+    for toplevel in gtk.window_list_toplevels():
+        toplevel.destroy()
+    assert gtk.window_list_toplevels() == []
+
+    windows = [gtk.Window() for x in range(3)]
+    assert len(gtk.window_list_toplevels()) == 3
+    for topwin, win in zip(gtk.window_list_toplevels(), windows):
+        assert topwin == win



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