[pygobject] Improve testcase for tree_view_column_set_attributes
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Improve testcase for tree_view_column_set_attributes
- Date: Tue, 31 Jul 2012 06:51:39 +0000 (UTC)
commit a8338a991bbe919f0e2d9b92f7b71f89ccd2c875
Author: Manuel QuiÃones <manuq laptop org>
Date: Mon Jul 30 12:53:36 2012 -0300
Improve testcase for tree_view_column_set_attributes
Signed-off-by: Manuel QuiÃones <manuq laptop org>
https://bugzilla.gnome.org/show_bug.cgi?id=680320
tests/test_overrides.py | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 2aa803a..cea3e34 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -1662,10 +1662,26 @@ class TestGtk(unittest.TestCase):
style=2)
def test_tree_view_column_set_attributes(self):
- cell = Gtk.CellRendererText()
+ store = Gtk.ListStore(int, str)
+ directors = ['Fellini', 'Tarantino', 'Tarkovskiy']
+ for i, director in enumerate(directors):
+ store.append([i, director])
+
+ treeview = Gtk.TreeView()
+ treeview.set_model(store)
+
column = Gtk.TreeViewColumn()
+ treeview.append_column(column)
+
+ cell = Gtk.CellRendererText()
column.pack_start(cell, expand=True)
- column.set_attributes(cell, text=0, style=2)
+ column.set_attributes(cell, text=1)
+
+ # This will make cell.props.text receive a value, otherwise it
+ # will be None.
+ treeview.get_preferred_size()
+
+ self.assertTrue(cell.props.text in directors)
def test_tree_selection(self):
store = Gtk.ListStore(int, str)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]