aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-08-19 09:01:29 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-08-19 09:01:29 +0200
commitcb93ce335cda4b8a8214350b157c55f0c80062d9 (patch)
treedd60ba6b8ac7397b347aebc4e801d37c9028e4df /sources/shiboken2/tests
parent29ab4674dc90c216ab17c7a8022f529f9a46eef7 (diff)
parent1b923556f315d22e5ac6febce8ddafb4cb2dd8a2 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Diffstat (limited to 'sources/shiboken2/tests')
-rw-r--r--sources/shiboken2/tests/samplebinding/objecttype_test.py8
-rw-r--r--sources/shiboken2/tests/smartbinding/smart_pointer_test.py12
2 files changed, 20 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/samplebinding/objecttype_test.py b/sources/shiboken2/tests/samplebinding/objecttype_test.py
index bda14c69c..f1a06c2b1 100644
--- a/sources/shiboken2/tests/samplebinding/objecttype_test.py
+++ b/sources/shiboken2/tests/samplebinding/objecttype_test.py
@@ -118,5 +118,13 @@ class ObjectTypeTest(unittest.TestCase):
self.assertLess(abs(before - after), 5)
+ def testInvalidProperty(self):
+ o = ObjectType()
+ try:
+ o.typo
+ self.assertFail()
+ except AttributeError as error:
+ self.assertEqual(error.args[0], "'sample.ObjectType' object has no attribute 'typo'")
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/shiboken2/tests/smartbinding/smart_pointer_test.py b/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
index e07856e61..e1883c7cc 100644
--- a/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
+++ b/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
@@ -175,5 +175,17 @@ class SmartPointerTests(unittest.TestCase):
self.assertEqual(len(ptrToObjList), 0)
self.assertEqual(objCount(), 1)
+ def testInvalidParameter(self):
+ # Create Obj.
+ o = Obj()
+ # Create a shared pointer to an Obj together with an Obj.
+ ptrToObj = o.giveSharedPtrToObj()
+ try:
+ ptrToObj.typo
+ self.assertFail()
+ except AttributeError as error:
+ self.assertEqual(error.args[0], "'smart.SharedPtr_Obj' object has no attribute 'typo'")
+
+
if __name__ == '__main__':
unittest.main()