testinggtk r209 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r209 - trunk/tests
- Date: Sat, 21 Jun 2008 18:30:58 +0000 (UTC)
Author: bjornl
Date: Sat Jun 21 18:30:58 2008
New Revision: 209
URL: http://svn.gnome.org/viewvc/testinggtk?rev=209&view=rev
Log:
Two test cases for ensuring that the cell renderers properties are kept in sync with the cell views 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 18:30:58 2008
@@ -89,3 +89,41 @@
def test_set_displayed_row_no_model():
cv = gtk.CellView()
cv.set_displayed_row((0, 1, 2))
+
+def test_get_cell_renderers_changes_cell_renderers():
+ '''
+ Ensure that calling ``get_cell_renderers`` does not update the
+ cell renderers in the ``gtk.CellView``.
+
+ :bug: #539503
+ '''
+ store = gtk.ListStore(str)
+ store.append(['foo'])
+ cv = gtk.CellView()
+ cv.set_model(store)
+ cr = gtk.CellRendererText()
+ cv.pack_start(cr)
+ cv.add_attribute(cr, 'text', 0)
+ cv.set_displayed_row((0,))
+ text = cr.get_property('text')
+ cv.get_cell_renderers()
+ assert cr.get_property('text') == text
+
+def test_cell_renderes_update_when_row_changes():
+ '''
+ Ensure that what the cell renderers show is updated when the row
+ that is displayed changes in the ``gtk.CellView``.
+
+ :bug: #539503
+ '''
+ store = gtk.ListStore(str)
+ store.append(['foo'])
+ cv = gtk.CellView()
+
+ cr = gtk.CellRendererText()
+ cv.pack_start(cr)
+ cv.add_attribute(cr, 'text', 0)
+ cv.set_model(store)
+ cv.set_displayed_row((0,))
+
+ assert cr.get_property('text') == 'foo'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]