summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-07 17:31:22 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-08 18:37:52 -0300
commit62c909a374789f16ad97014464f91821f714cea6 (patch)
tree63b1c0cd2aa2301984022db067a0809fdf9c3683 /tests/samplebinding
parent0650666ccfe1ac83b20a4ffffa1d8b61669c2dd8 (diff)
downloadshiboken-62c909a374789f16ad97014464f91821f714cea6.tar.gz
shiboken-62c909a374789f16ad97014464f91821f714cea6.tar.xz
shiboken-62c909a374789f16ad97014464f91821f714cea6.zip
Better error messages when reimplementing virtual methods.
Diffstat (limited to 'tests/samplebinding')
-rwxr-xr-xtests/samplebinding/virtualmethods_test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/samplebinding/virtualmethods_test.py b/tests/samplebinding/virtualmethods_test.py
index be8abfb8..0ddb7e44 100755
--- a/tests/samplebinding/virtualmethods_test.py
+++ b/tests/samplebinding/virtualmethods_test.py
@@ -29,7 +29,7 @@
import sys
import unittest
-from sample import VirtualMethods, VirtualDaughter, Point, Str
+from sample import *
class ExtendedVirtualMethods(VirtualMethods):
def __init__(self):
@@ -40,6 +40,10 @@ class ExtendedVirtualMethods(VirtualMethods):
self.virtual_method0_called = True
return VirtualMethods.virtualMethod0(self, pt, val, cpx, b) * -1.0
+ def strListToStdList(self, arg):
+ # returnning wrong type for test purporses.
+ return True
+
class ExtendedVirtualDaughter(VirtualDaughter):
def __init__(self, name):
VirtualDaughter.__init__(self, name)
@@ -107,6 +111,10 @@ class VirtualMethodsTest(unittest.TestCase):
self.assert_(eevd.grand_grand_daughter_name_called)
self.assertEqual(eevd.name().prepend(self.prefix_from_codeinjection), name)
+class PrettyErrorMessageTest(unittest.TestCase):
+ def testIt(self):
+ obj = ExtendedVirtualMethods()
+ self.assertRaises(TypeError, obj.callStrListToStdList, StrList())
if __name__ == '__main__':
unittest.main()