summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/enum_test.py
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-04-29 18:41:50 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-30 09:46:49 -0300
commitd402db5680452241a5b85f7a4fd7db9bcc9ddbb8 (patch)
treed6060572479ded20796bd848f6e816539eeddda5 /tests/samplebinding/enum_test.py
parent902c70b6f34c6c712d867047d2e58ac41864c0be (diff)
downloadshiboken-d402db5680452241a5b85f7a4fd7db9bcc9ddbb8.tar.gz
shiboken-d402db5680452241a5b85f7a4fd7db9bcc9ddbb8.tar.xz
shiboken-d402db5680452241a5b85f7a4fd7db9bcc9ddbb8.zip
Adding test for #212 - Overloads with enums
Diffstat (limited to 'tests/samplebinding/enum_test.py')
-rwxr-xr-xtests/samplebinding/enum_test.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py
index a6c2e042..0d4be229 100755
--- a/tests/samplebinding/enum_test.py
+++ b/tests/samplebinding/enum_test.py
@@ -28,7 +28,7 @@
import unittest
-from sample import SampleNamespace
+from sample import SampleNamespace, ObjectType, Event
class EnumTest(unittest.TestCase):
'''Test case for Python representation of C++ enums.'''
@@ -66,6 +66,18 @@ class EnumTest(unittest.TestCase):
'''Calling the constructor of non-extensible enum with a string.'''
self.assertRaises(TypeError, SampleNamespace.InValue, '1')
+
+class EnumOverloadTest(unittest.TestCase):
+ '''Test case for overloads involving enums'''
+
+ def testWithInt(self):
+ '''Overload with Enums and ints with default value'''
+ o = ObjectType()
+
+ self.assertEqual(o.callWithEnum('', Event.ANY_EVENT, 9), 81)
+ self.assertEqual(o.callWithEnum('', 9), 9)
+
+
if __name__ == '__main__':
unittest.main()