diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/samplebinding/enum_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py index 698287f9d..22e6b917c 100644 --- a/tests/samplebinding/enum_test.py +++ b/tests/samplebinding/enum_test.py @@ -60,6 +60,7 @@ class EnumTest(unittest.TestCase): '''Conversion of enum objects from Python to C++ back again.''' enumout = SampleNamespace.enumInEnumOut(SampleNamespace.TwoIn) self.assert_(enumout, SampleNamespace.TwoOut) + self.assertEqual(repr(enumout), repr(SampleNamespace.TwoOut)) def testEnumConstructorWithTooManyParameters(self): '''Calling the constructor of non-extensible enum with the wrong number of parameters.''' @@ -98,6 +99,15 @@ class EnumTest(unittest.TestCase): self.assertEqual(text, repr(Event.ANY_EVENT)) +class MyEvent(Event): + def __init__(self): + Event.__init__(self, Event.EventType(999)) + +class OutOfBoundsTest(unittest.TestCase): + def testValue(self): + e = MyEvent() + self.assertEqual(repr(e.eventType()), '<enum-item EventType.#out of bounds# (999)>') + class EnumOverloadTest(unittest.TestCase): '''Test case for overloads involving enums''' |