aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-12-28 10:46:37 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-12-28 10:47:54 -0300
commit2fc991d0239cfa0111c5fa9629e183add4076bbf (patch)
tree1dbfed1c58b4432be4349bdaf3d3ba5f39e2b6cc /tests/samplebinding
parentff6ac013b7be3b4900a0abfe57e1467fcf908635 (diff)
Adds test case for type discovery.
C++ returns a new instance of Derived as its ancestor Abstract pointer and the bindings must produce a Python wrapper of Derived type. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'tests/samplebinding')
-rwxr-xr-xtests/samplebinding/derived_test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/samplebinding/derived_test.py b/tests/samplebinding/derived_test.py
index 32d70f49a..4c96c5056 100755
--- a/tests/samplebinding/derived_test.py
+++ b/tests/samplebinding/derived_test.py
@@ -138,6 +138,11 @@ class DerivedTest(unittest.TestCase):
d = Derived(objId)
self.assertEqual(Abstract.getObjectId(d), objId)
+ def testObjectCreationWithParentType(self):
+ '''Derived class creates an instance of itself in C++ and returns it as a pointer to its ancestor Abstract.'''
+ obj = Derived.createObject()
+ self.assertEqual(type(obj), Derived)
+
if __name__ == '__main__':
unittest.main()