testinggtk r190 - trunk/tests



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

Log:
Test for setting oob displayed row

Modified:
   trunk/tests/test_cellview.py

Modified: trunk/tests/test_cellview.py
==============================================================================
--- trunk/tests/test_cellview.py	(original)
+++ trunk/tests/test_cellview.py	Sat Jun 21 14:54:59 2008
@@ -23,10 +23,10 @@
     assert cv.get_model() == store
 
 def test_set_get_displayed_row():
-    cv = gtk.CellView()
     store = gtk.ListStore(str)
     store.append(['foo'])
     store.append(['boo'])
+    cv = gtk.CellView()
     cv.set_model(store)
     cv.set_displayed_row((1,))
     assert cv.get_displayed_row() == (1,)
@@ -35,6 +35,20 @@
     cv.set_displayed_row(None)
     assert not cv.get_displayed_row()
 
+ utils pass_on_warnings
+def test_set_displayed_row_oob():
+    '''
+    Ensure that a warning is printed when the displayed row is set to
+    a tree path out of bounds.
+
+    :bug: #539468
+    '''
+    store = gtk.ListStore(str)
+    cv = gtk.CellView()
+    cv.set_model(store)
+    cv.set_displayed_row((1, 2, 3))
+    assert not cv.get_displayed_row()
+
 @utils.pass_on_warnings    
 def test_set_displayed_row_no_model():
     cv = gtk.CellView()



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