testinggtk r370 - trunk/tests



Author: bjornl
Date: Mon Aug 18 19:09:40 2008
New Revision: 370
URL: http://svn.gnome.org/viewvc/testinggtk?rev=370&view=rev

Log:
New test for gtk.cell_view_new_with_text

Modified:
   trunk/tests/test_cellview.py

Modified: trunk/tests/test_cellview.py
==============================================================================
--- trunk/tests/test_cellview.py	(original)
+++ trunk/tests/test_cellview.py	Mon Aug 18 19:09:40 2008
@@ -9,6 +9,24 @@
     assert not cv.get_property('model')
     assert not cv.get_displayed_row()
 
+def test_new_with_text():
+    '''
+    Ensure that a ``gtk.CellView`` instantiated using
+    ``gtk.cell_view_new_with_text`` has one ``gtk.CellRendererText``
+    renderer with the correct properties.
+    '''
+    store = gtk.ListStore(int)
+    store.append([3])
+    cv = gtk.cell_view_new_with_text('foo')
+    cv.set_model(store)
+    cv.set_displayed_row((0,))
+
+    renderers = cv.get_cell_renderers()
+    assert len(renderers) == 1
+    cr_text = renderers[0]
+    assert isinstance(cr_text, gtk.CellRendererText)
+    assert cr_text.get_property('text') == 'foo'
+
 @utils.fail_on_warnings    
 def test_get_default_cell_renderers():
     '''



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