testinggtk r445 - trunk/tests



Author: bjornl
Date: Wed Sep 10 15:47:37 2008
New Revision: 445
URL: http://svn.gnome.org/viewvc/testinggtk?rev=445&view=rev

Log:
Add test for cell_set_cell_data() with data with incompatible type

Modified:
   trunk/tests/test_treeviewcolumn.py

Modified: trunk/tests/test_treeviewcolumn.py
==============================================================================
--- trunk/tests/test_treeviewcolumn.py	(original)
+++ trunk/tests/test_treeviewcolumn.py	Wed Sep 10 15:47:37 2008
@@ -45,3 +45,20 @@
                    gtk.TREE_VIEW_COLUMN_GROW_ONLY):
         col.set_sizing(sizing)
         assert col.get_sizing() == sizing
+
+ utils pass_on_warnings
+def test_cell_set_cell_data_with_incompatible_type():
+    '''
+    In this test ``gtk.TreeViewColumn.cell_set_cell_data`` is called
+    with an iterator that points to a ``gtk.ListStore`` row whose cell
+    contains data of type ``object``. When the ``text`` property of
+    the ``gtk.CellRendererText`` is assigned with the cells data a
+    warning should be shown because type ``PyObject`` cannot be
+    converted to ``gchararray``.
+    '''
+    store = gtk.ListStore(object)
+    store.append(['hi'])
+    cr = gtk.CellRendererText()
+    col = gtk.TreeViewColumn("c1", gtk.CellRendererText(), text = 0)
+    iter = store.get_iter((0,))
+    col.cell_set_cell_data(store, iter, False, False)



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