[pygobject] override test fixes for new GTK+ annotations



commit 3d9fd6391710cc33058394d6821e4d4e11f09b22
Author: John (J5) Palmieri <johnp redhat com>
Date:   Thu Jul 8 12:54:43 2010 -0400

    override test fixes for new GTK+ annotations

 tests/test_overrides.py |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index bf5f22b..0a66587 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -184,18 +184,20 @@ class TestGtk(unittest.TestCase):
             testobj = TestClass(self, i, label)
             parent = tree_store.append(parent, (i, label, testobj))
 
-        self.assertEquals(len(tree_store), 100)
+        # len gets the number of children in the root node
+        # since we kept appending to the previous node
+        # there should only be one child of the root
+        self.assertEquals(len(tree_store), 1)
 
         # walk the tree to see if the values were stored correctly
-
         parent = None
         i = 0
 
         (has_children, treeiter) = tree_store.iter_children(parent)
         while (has_children):
-           i = tree_store.get_value(iter, 0)
-           s = tree_store.get_value(iter, 1)
-           obj = tree_store.get_value(iter, 2)
+           i = tree_store.get_value(treeiter, 0)
+           s = tree_store.get_value(treeiter, 1)
+           obj = tree_store.get_value(treeiter, 2)
            obj.check(i, s)
            parent = treeiter
            (has_children, treeiter) = tree_store.iter_children(parent)
@@ -215,12 +217,13 @@ class TestGtk(unittest.TestCase):
         # walk the list to see if the values were stored correctly
         i = 0
         (has_more, treeiter) = list_store.get_iter_first()
+
         while has_more:
-           i = list_store.get_value(treeiter, 0)
-           s = list_store.get_value(treeiter, 1)
-           obj = list_store.get_value(treeiter, 2)
-           obj.check(i, s)
-           (has_more, treeiter) = list_store.iter_next()
+            i = list_store.get_value(treeiter, 0)
+            s = list_store.get_value(treeiter, 1)
+            obj = list_store.get_value(treeiter, 2)
+            obj.check(i, s)
+            has_more = list_store.iter_next(treeiter)
 
         self.assertEquals(i, 99)
 



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