aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/ownership_invalidate_parent_test.py
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-09-24 11:25:41 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:07:19 -0300
commit85f926e8fef29967393a11832ac26cafecc9b777 (patch)
treed547a700b60a3bfa3f27c5fbc7cdffe2a60fd27b /tests/samplebinding/ownership_invalidate_parent_test.py
parenta0bd7044da2150e096ab197302b5c77a845c8682 (diff)
Created unit test to unsafe parent (parent created from c++)
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/samplebinding/ownership_invalidate_parent_test.py')
-rw-r--r--tests/samplebinding/ownership_invalidate_parent_test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/samplebinding/ownership_invalidate_parent_test.py b/tests/samplebinding/ownership_invalidate_parent_test.py
index b99951c4b..509bfcf4d 100644
--- a/tests/samplebinding/ownership_invalidate_parent_test.py
+++ b/tests/samplebinding/ownership_invalidate_parent_test.py
@@ -38,19 +38,24 @@ class InvalidateParentTest(unittest.TestCase):
'''Invalidate parent should invalidate children'''
parent = ObjectType.create()
child1 = ObjectType(parent)
+ child1.setObjectName("child1")
child2 = ObjectType.create()
+ child2.setObjectName("child2")
child2.setParent(parent)
grandchild1 = ObjectType(child1)
+ grandchild1.setObjectName("grandchild1")
grandchild2 = ObjectType.create()
+ grandchild2.setObjectName("grandchild2")
grandchild2.setParent(child2)
bbox = BlackBox()
bbox.keepObjectType(parent) # Should invalidate the parent
self.assertRaises(RuntimeError, parent.objectName)
- self.assertRaises(RuntimeError, child1.objectName)
+ # some children still valid they are wrapper classes
+ self.assertEqual(child1.objectName(), "child1")
self.assertRaises(RuntimeError, child2.objectName)
- self.assertRaises(RuntimeError, grandchild1.objectName)
+ self.assertEqual(grandchild1.objectName(), "grandchild1")
self.assertRaises(RuntimeError, grandchild2.objectName)
if __name__ == '__main__':