aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-29 00:19:47 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-30 13:11:16 -0300
commit0e2de944d5ddfce144a824280e08febbc8a1271a (patch)
tree3e01ab30d86a5fac291bc715f6faf6f26df6970d /tests
parent22fb6d89c445174e77afe698d247c72d05e1576a (diff)
Wrapper invalidation method recursively updates children objects status.
BindingManager::invalidateWrapper checks if the object to be invalidated carries any children objects and recursively invalidates them. Shiboken::destroyParentInfo function was refactored to call the new recursive wrapper invalidator and then call a helper function that only destroy the parent information. The invalidate parent test was updated.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/samplebinding/ownership_invalidate_parent_test.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/samplebinding/ownership_invalidate_parent_test.py b/tests/samplebinding/ownership_invalidate_parent_test.py
index c3400822f..67879b807 100755
--- a/tests/samplebinding/ownership_invalidate_parent_test.py
+++ b/tests/samplebinding/ownership_invalidate_parent_test.py
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
-'''Tests for destroying the parent'''
+'''Tests for invalidating a parent of other objects.'''
import unittest
@@ -37,13 +37,22 @@ class InvalidateParentTest(unittest.TestCase):
def testInvalidateParent(self):
'''Invalidate parent should invalidate children'''
parent = ObjectType.create()
- child = ObjectType(parent)
+ child1 = ObjectType(parent)
+ child2 = ObjectType.create()
+ child2.setParent(parent)
+ grandchild1 = ObjectType(child1)
+ grandchild2 = ObjectType.create()
+ grandchild2.setParent(child2)
bbox = BlackBox()
bbox.keepObjectType(parent) # Should invalidate the parent
self.assertRaises(RuntimeError, parent.objectName)
- self.assertRaises(RuntimeError, child.objectName)
+ self.assertRaises(RuntimeError, child1.objectName)
+ self.assertRaises(RuntimeError, child2.objectName)
+ self.assertRaises(RuntimeError, grandchild1.objectName)
+ self.assertRaises(RuntimeError, grandchild2.objectName)
if __name__ == '__main__':
unittest.main()
+